Extending vs. Using Data Structures

I'm fairly new to Java, though not to coding in general, and I'm wondering, whether its better to extend a data structure or to use one, when creating a class.
For example, I've been messing around with some playing cards, and to make the deck, I essentially want to use a stack. Would it be better to create a Deck class that extends Stack, or to create a Deck class that contains a Stack object and methods that modify the Stack? I've tried it both ways, and they both seem to do okay, but I'm wondering which way is preferable.
So far, inheriting seems more powerful, but using is much cleaner. (e.g. I don't have to worry about them calling pop() instead of draw())
Edited by: chess19 on Mar 16, 2009 6:19 PM

You seem to be on track in terms of the issues involved. If you google for the phrase "prefer composition to inheritance" you'll find a lot of people with relevant advice.

Similar Messages

  • Implement a program by using data structure

    i've learn link-list,b-tree,red black tree,hash table. now it's time for me to implement a program using any one of these. i've no idea about how to start, and what kind of program should i write? what kind of program use data structure? i want some simple example program to make me understand. can anyone help me?
    thank 4 u r time,
    makio

    what sort of program do use data structure? let's say
    i want to use binary search on data , how can i?As nasch said: pretty much any program uses data structures.
    Okay, let's say you want to try binary search. You could do that on an array, on a singly linked list, on a doubly linked list, probably on others that I can't think of right now.
    If you just want practice using the data structures you've learned, then why not write a binary search over several different ones? That will give you a feel for how they differ in usage and performance.
    Or, you can just pick any kind of program that interests you. Unless it's trivially small and simple, there will probably be a use for one or more of the data strux you've learned.
    A chat program needs data structures to hold curently connected users, ongoing conversations, maybe a queue for messages waiting to be sent.
    A card game needs to be able to search to see if a given card is in a given hand. Needs to hold all the cards in a deck that has to be shuffled. Dealing is like popping off a stack.
    A database of students and their courses might want to keep something in an ordered tree--by last name for instance.
    What applications interest you?

  • Extend Data Structure

    Hi..
    I want to add some fields into data structure 0FI_AP_3.
    With this data structure , extract structure named DTFIAP_3 is there. I have added the fields into this extend structure. But when I m using the RSA3 these fields are not appearing there.
    Please suggest me.
    Thanks a lot.
    Pankaj Angra

    Hi Pankaj ,
            After adding the fields you have to unhide the added fields in T-Code RSA6 for the data source 0FI_AP_3 by removing hide check box . Have you done that? .
    If you have done this and still fields are not appering in RSA3 you can go to the path settings->Layout->Current and move your added fields from right to left so that layout displays the added fields.
    Regards,
    Prakash B

  • Can I automate the creation of a cluster in LabView using the data structure created in an autogenerated .CSV, C header, or XML file?

    Can I automate the creation of a cluster in LabView using the data structure created in an auto generated .CSV, C header, or XML file?  I'm trying to take the data structure defined in one or more of those files listed and have LabView automatically create a cluster with identical structure and data types.  (Ideally, I would like to do this with a C header file only.)  Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I've looked into EasyXML and contacted the rep for the add-on.  Unfortunately, this capability has not been created yet.  Has anyone done something like this before? Thanks in advance for the help.  
    Message Edited by PhilipJoeP on 04-29-2009 04:54 PM
    Solved!
    Go to Solution.

    smercurio_fc wrote:
    Is this something you're trying to do at runtime? Clusters are fixed data structures so you can't change them programmatically. Or, are you just trying to create some typedef cluster controls so that you can use them for coding? What would your clusters basically look like? Perhaps another way of holding the information like an array of variants?
    You can try LabVIEW scripting, though be aware that this is not supported by NI. 
     Wow!  Thanks for the quick response!  We would use this cluster as a fixed data structure.  No need to change the structure during runtime.  The cluster would be a cluster of clusters with multiple levels.  There would be not pattern as to how deep these levels would go, or how many elements would be in each.   Here is the application.  I would like to be able to autocode a Simulink model file into a DLL.  The model DLL would accept a Simulink bus object of a certain data structure (bus of buses), pick out which elements of the bus is needed for the model calculation, and then pass the bus object.  I then will take the DLL file and use the DLL VI block to pass a cluster into the DLL block (with identical structure as the bus in Simulink).  To save time, I would like to auto generate the C header file using Simulink to define the bus structure and then have LabView read that header file and create the cluster automatically.   Right now I can do everything but the auto creation of the cluster.  I can manually build the cluster to match the Simulink model bus structure and it runs fine.  But this is only for an example model with a small structure.  Need to make the cluster creation automated so it can handle large structures with minimal brute force. Thanks!  

  • Is timesten still using T-tree as data structure?

    I just come across this paper - http://www.memdb.com/paper.pdf , this researcher do some experiments and showing that using concurrent B-tree algorithm is actually faster than T-tree operation. How do you think about this paper? Do you think actually he is using a inefficient algorithm to access T-tree? Or, Timesten already know the limitation of T-tree and have changed the internal data-structure?

    Yes, we are aware of the comparisons between T-Trees, concurrent B-trees etc. At the moment TimesTen still uses T-trees but this may change in the future :-)
    Chris

  • Need help on efficient searches using hashes on large #s of data structures

    I have a massive amount of data and I need a way to access it using generated indexes instead of traditional searching such as binary chop as I require a fast response time.
    I have 100,000 Array data structures each containing roughly 10 to 60 elements. The elements of the Arrays do not store any raw data they just hold references to objects. I have about 10,000 unique objects which are referenced to by the arrays.
    What I need to do is supply a number of objects as the query and the system should return all the arrays which contain two or more different objects from the query.
    So for example>
    Given query objects> “DER” , “ERE” , “YPS”
    and arrays> [DER, SFR, PPR]
         [PER, ERE, SWE, YPS]
         [ERE, PPD, DER, YPS, SWE]     
         [PRD, LDF, WSA, MMD]
    It should return arrays 2 and 3.
    I had a look at hashMaps but I’m not entirely sure if that’s what I need.
    Would I need to hash the each Array and then hash the query objects and look for overlaps in the two hashes or something similar?
    Thanks In Advance

    For a single query, it's more efficient to do less work, so don't create intermediate objects, don't create a index of objects to sets of possibles, and stop counting matches when you find enough:.
                    final HashSet<String> querySet = new HashSet<String>(Arrays.asList(query));
                    final Set<String> results = new LinkedHashSet<String>();
                    // find matches using scan of all arrays
                    for (String[] array : data) {
                        int matchCount = 0;
                        for (String elt : array) {
                            if (querySet.contains(elt)) {
                                ++matchCount;
                                if (matchCount >= 2) {
                                    results.add(Arrays.asList(array).toString());
                                    break;
                    }Using random data, 100,000 arrays of selections from a list of 10,000 trigrams, scanning all the arrays takes about as long as the set code, but doesn't require generation of the map, which can take up a lot of memory if you pre-create the sets (I didn't complete a run doing that, although it should be faster to query, it used too much memory and my computer started swapping so I gave up after a few minutes).
    Running queries of size 2 to 25, times in ms:
    linear scan of all arrays in data set:
    elapsed: 2196
    creating index of trigram to arrays containing trigram:
    elapsed: 4635
    query using set union and index lookup:
    elapsed: 2195
    query using direct scan and index lookup:
    elapsed: 164
    So if I was doing one query per dataset, just use a simple scan as above. If you're doing lots on the same dataset, then create a map<String, List<String[]>> to index the arrays, and the lookup will save quite a bit of time.
    Creating the index:.
                dataSets = new HashMap<String, List<String[]>>();
                for (String trigram : trigrams)
                    dataSets.put(trigram, new ArrayList<String[]>());
                for (String[] array : data)
                    for (String trigram : array)
                        dataSets.get(trigram).add(array);Finding matches using scan of arrays with at least one elt in query:.
                    final HashSet<String> querySet = new HashSet<String>(Arrays.asList(query));
                    final Set<String> results = new LinkedHashSet<String>();
                    for (String trigram : query) {
                        for (String[] array : dataSets.get(trigram)) {
                            for (String elt : array) {
                                if (elt != trigram && querySet.contains(elt)) {
                                    results.add(Arrays.asList(array).toString());
                                    break;
                    }

  • New g/l-&  Extended Data Structure

    hi
    can anyone tell me how to Configured New GL and perform document splitting.
    what r the concepts for New GL in the areas of Extended Data Structure
    regards
    amulya
    Edited by: amulya chowdary on Jan 22, 2008 6:34 AM

    Hi
    Iam providing the necessary configuration steps for New G/L
    1Define Currencies for Leading Ledger:
    Financial Accounting (New)>**** (New)>Ledgers>Ledger>Define currencies of The leading ledger
    2.Define Ledger for General Ledger Accounting
    F/A (New) > ****/ (New) > Ledgers >Ledger > Define Ledgers for General Ledger Accounting
    3.Assigning Scenarios to Ledger
    Financial Accounting (New)>**** (New)>Ledgers>Ledger>Assign scenarios & Customer fields to ledger
         Following Predefined Scenarios is assigned to the Non leading Ledger
         Cost Centre
         Preparation for Consolidation
         Business Area
         Profit Centre Update
         Segmentation
         Cost of Sales Accounting
    4.Define and activate Non Leading Ledger:
    Financial Accounting (New)>****(New)>Ledgers>Ledger> Define and activateNon Leading Ledger
    5.     Defining Segment
         Enterprise Structure>Definition>Financial Accounting >Define segment
         We will assign this segment in the Normal Profit Centre
         Hence we will be getting reports for Segment 001
    6.     Activate Document Splitting:
    FA(N)>GLA(N) Business Transactions> Doc.Splitting >Activate Doc Splitting
         Spl Note: Always see that the tick is on inheritance
    7.Classify G/L Accts for Document Splitting:
    Financial Accounting (New)>General Ledger Accounting (New)>Business Transactions>Document splitting> Classify G/L Accts for Document Splitting
    For the G/L created in the Company Code , Give from and to and give the category to which, The G/L Belongs
    What ever G/L account is created we have select the category from the predefined Groups      in the system
    8.Classify Document Types for Document Splitting:
    Financial Accounting (New)>General Ledger Accounting (New)>Business Transactions>Document Splitting> Classify Documents Types for Document
    Here No Changes are done, only standard setting is followed.
    Standard Documents Types are predefined by SAP, No configuration changes need been made in this configuration step.
    9.DEFINE DOCUMENT SPLITTING CHARACTERISTICS FOR GENERAL LEDGER ACCOUNTING:
    Financial Accounting (New)>General Ledger Accounting (New)>Business Transactions>Document splitting>Define Doc Splitting Characteristic for General Ledger Accounting
         Here we have to define, Document Splitting Characteristics like
         Business Area,
         Profit center and
         Segment
    10.Define Zero Balancing Clearing Account:
    Financial Accounting (New)>General Ledger Accounting (New)>Business Transactions>Document splitting>Define Zero Balance Clearing Account
    Enter the G/L Acct which we have created for Zero BAL Clearing Accts
    Save It
    11.DEFINE DOCUMENT SPLITTING CHARACTERISTICS FOR CONTROLLING.
    Financial Accounting (New)>General Ledger Accounting (New)>Business Transactions>Document splitting>Define Doc Splitting Characteristic for Controlling
    Here we are defining Cost Centre as: Doc Splitting Characteristic for Controlling.
    12.FI- Co Real Time Integration
    Financial Accounting (New)>**** (New)>ledgers>real time integration of Controlling with financial Accounting>Define variants for Real time      integration
    In this IMG activity, you define variants for the real-time integration of Controlling (CO) with Financial Accounting (FI).
    13.Assign variants for Real Time Integration to Company Codes:
    Financial Accounting (New)>**** (New)>ledgers>real time integration of Controlling with financial Accounting>Assign variants for Real time integration to Co Codes
    Here we have to assign the variant to our company code.
    15. Financial Accounting (New)>**** (New) Docs >Define Doc types for General
          Ledger View.
    16.Financial Accounting (New)>**** (New) Docs > Doc Number Ranges >Define 
         Doc No Range for GL View.
    ASSIGN ME POINTS

  • Using xsd:group in Report Data Structure

    Hi all,
    I am totally new to BI Publisher trying to create a report with a data structure specified by an XML schema. This schema makes heavy use of the XML schema construct 'group', e.g. like
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:group name="custGroup">
    <xs:sequence>
    <xs:element name="customer" type="xs:string"/>
    <xs:element name="orderdetails" type="xs:string"/>
    <xs:element name="billto" type="xs:string"/>
    <xs:element name="shipto" type="xs:string"/>
    </xs:sequence>
    </xs:group>
    <xs:element name="order" type="ordertype"/>
    <xs:complexType name="ordertype">
    <xs:group ref="custGroup"/>
    <xs:attribute name="status" type="xs:string"/>
    </xs:complexType>
    </xs:schema>
    </xsd:sequence>
    </xsd:complexType>
    When importing this schema into the Word Template Builder the shown attributes do not contain the elements specified in the group but only the element 'order' of type 'ordertype'.
    Could you point me to the solution of this issue - if any? Or is BI Publisher not able to handle xsd:group constructs?
    Thanks in advance.
    Best regards,
    Stefan

    The feature has some restrictions. Does the following work for you?
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="order" type="ordertype"/>
    <xs:complexType name="ordertype">
    <xs:group ref="custGroup"/>
    <xs:attribute name="status" type="xs:string"/>
    </xs:complexType>
    <xs:group name="custGroup">
    <xs:sequence>
    <xs:element name="customer" type="xs:string"/>
    <xs:element name="orderdetails" type="xs:string"/>
    <xs:element name="billto" type="xs:string"/>
    <xs:element name="shipto" type="xs:string"/>
    </xs:sequence>
    </xs:group>
    </xs:schema>

  • How to use event structure of event data nodes event filter nodes in programming

    hi,
    I need manual of how to use 'event structure' events of 'event data nodes' and 'event data filters'...please help me....
    Regards
    Ravindranath

    I'm not really sure what you are looking for here.  Did you do a search in the LabVIEW help for Event Structure?
    The Event Data Node just returns information about the event, like control data, control reference, what caused the event, etc.
    The Event Data Filters are just used in Filter Events.  This allows you to discard an event or change the data that the event will recieve.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • What kind of data structure should I use?

    I have a user input dialog basically like following which need user input the sample number to specifiy each file belongs to which sample:
    user input the sample number in the following dialog:
    file name             sample
    test 1                  1
    test2                   2
    test3                   1
    test4                   2In another words, each sample could include multiple files, each file has a column of data. I tried to get
    a data structure which specifies the sample and file relationship, to get an idea of what kind of files are in
    one sample. I tried to use hashmap or hashtable, but they ask the key must be unique. What I need is to get the sample data structure for the later data processing.
    thanks in advance!

    You could make a Sample object, which creates a List of file names. Then put SampleNumber and SampleObject into a Map...
      class Sample {
        java.util.List fileNames;
        Sample()
        {  fileNames = java.util.ArrayList(5); }
        addFile(String fName)
        { fileNames.add(fName); }
        String[] getFileNames()
          String[] names = new String[fileNames.size()];
          for (int a = 0; a < names.length; a++)
          { names[a] = fileNames.get(a).toString(); }
          return names;
      Map samples = new HashMap();
      Sample samp1 = new Sample();
      samp1.addFile("Test1"); samp1.addFile("Test3");
      Sample samp2 = new Sample();
      samp2.addFile("Test2"); samp2.addFile("Test4");
      samples.add("1", samp1);
      samples.add("2", samp2);
      String selected = //String user selects...
      Sample sampNeeded = (Sample)samples.get(selected);
      String[] files = sampNeeded.getFileNames();

  • Using a single data structure in a desktop application

    Hello,
    I am programming an application that needs to constantly access a data structure, for instance to add / edit / update / search data. Several graphical user interfaces need to modify this data structure. I was wondering of easy ways to use the data structure throught the whole application. One solution I found was to use the singleton pattern for my data structure, though lots of people have recommended me to avoid using that pattern. What are better ways of accessing that single data structure from all of those GUIs ?
    Thank you,
    Alfredo

    Not that there is anything wrong with a Singleton pattern, but I don't see how it would help you in this case.
    Just create the DataStructure and let every GUI that need to use it have a reference to it.

  • Use idoc structure as Data Type....

    Hi all,
    this is my SYNC scenario: SOAP -> PI -> PROXY and the response in the same way.
    in the proxy I want to use the same Structure of the ORDERS05 iDoc...
    so..
    1: I've Imported the iDoc
    2: Created the external definition
    and then...
    first, I tried to use the IDOC in the "Message Interface" but when activate it, a message appear saying " references an IDoc message and a non-IDoc message"...
    well as it doesn't works...
    I tried with the external definition in the Message Interface... I can Activate it, but when go to ECC and try to regenerate the Proxy this is the error message "
    Interface uses external and internal message definitions"...
    so... my last chance was create a data type with the same structure... for it, imported the XSD but errors and more errors appears... so I think than my best way is not a data type... but I can't find a solution.
    someone has any idea??
    Thanks.

    > this is my SYNC scenario: SOAP -> PI -> PROXY and the response in the same way.
    >
    > in the proxy I want to use the same Structure of the ORDERS05 iDoc...
    > so..
    > 1: I've Imported the iDoc
    > 2: Created the external definition
    I hope you are just only using the structure of IDOC and not the IDOC itself. Because IDOC doesn't support SYNC scenario.
    > first, I tried to use the IDOC in the "Message Interface" but when activate it, a message appear saying " references an IDoc message and a non-IDoc message"...
    As I said you cannot use IDOC in Sync scenario, So this was because of that as per my understanding.
    > well as it doesn't works...
    >
    > I tried with the external definition in the Message Interface... I can Activate it, but when go to ECC and try to regenerate the Proxy this is the error message "
    >  Interface uses external and internal message definitions"...
    As per my experience, You cannot create Proxy with External Definition. I guess in PI7.1 it is possible.
    > so... my last chance was create a data type with the same structure... for it, imported the XSD but errors and more errors appears... so I think than my best way is not a data type... but I can't find a solution.
    >
    Yes you don't have any other option except creating the Data Type. So check what's going wrong when you are creating the it.
    Regards,
    Sarvesh

  • When to use specific data structures

    Hi
    I'm currently learning Java and have found a wealth of information on data structures (link lists,queues et. al.) but I'm finding not much material on when best to apply specific data structures and the advantages and disadvantages. Could anyone point me to any resources?
    Second question as a Java developer do you actually use things like linked lists etc regularly?
    Thanks in advance

    I suppose that a wealth of information exists because data structures are an integral part of programming. In simpler terms, all that information exists because the answer to question two is yes, absolutley.
    The answer to question one is a bit trickier. It's kind of like asking when is best to use a flathead vrs. a phillips screwdriver. The answer seems obvious within a given context, but obscure outside of one.
    IMHO: The 'when' becomes clear with experience. Focus on the 'how' and you'll be ready when you are faced with a problem that calls for a particular type of solution.
    jch

  • Which data structure to use in this scenario? queue, stack, list, ...

    Hi,
    I'm hesitant about what data structure to use (best efficient one) in the following scenario
    At a given moment I have an ordered set of data such as:
         (1,3,6,9,10)
    and a current value (by instance, 11)
    Then I need to access the LAST one (10) and
    If my value is greater I will add it to the list. In this example I will add 11 so the list will be (1,3,6,9,10,11)
    On the other hand, as a second step, I will iterate on the list as follows: I will get the first element, do something, then remove it, and go to next one until the list is empty. Therefore, basically I will access always the first element on the list.
    I don't really care about the elements in the middle.
    Which data structure do you suggest me to use?
    I was thinking on Queue (easy to access the head, and extract one by one in order), but I don't know how to get the tail element (10 in this case), as it is the one that tells me if I have to add another element...
    Thank you.

    >
    At a given moment I have an ordered set of data such as:
         (1,3,6,9,10)
    and a current value (by instance, 11)
    Then I need to access the LAST one (10) and
    If my value is greater I will add it to the list. In this example I will add 11 so the list will be (1,3,6,9,10,11)Any data structure will do, I would suggest a LinkedList.
    On the other hand, as a second step, I will iterate on the list as follows: I will get the first element, do something, then remove it, and go to next one until the list is empty. Therefore, basically I will access always the first element on the list.Use an iterator and the corresponding remove methods.
    Mel

  • Urgent! Need help in deciding data structure to use

    Hi all,
    I need to implement a restaurant system by which a customer can make a reservation.
    I was wondering whether vector would be able to be store such an object, The thing is I don't want a complex data structure. just sumthin simple cos i hardly have anytime left to my submission. sighz...
    The thing is I need to able to search based on 2 properties of an object. Eg. I need to search for a reservation based on the customer name and the date he reserved a table.
    But I am totally clueless how to search thru a vector based on 2 properties of the object... Would really appreciate some help. Like an example how to so so based on my program. Feelin so lost...This is all I have so far:
    class AddReservation
         static BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
         //Main Method
         public static void main (String[]args)throws IOException
              String custName, comments;
              int covers, date, startTime, endTime;
              int count = 0;
              //User can only add one reservation at a time
              do
                   //Create a new reservation
                   Reservation oneReservation=new Reservation();                         
                   System.out.println("Please enter customer's name:");
                   System.out.flush();
                   custName = stdin.readLine();
                   oneReservation.setcustName(custName);
                   System.out.println("Please enter number of covers:");
                   System.out.flush();
                   covers = Integer.parseInt(stdin.readLine());
                   oneReservation.setCovers(covers);
                   System.out.println("Please enter date:");
                   System.out.flush();
                   date = Integer.parseInt(stdin.readLine());
                   oneReservation.setDate(date);
                   System.out.println("Please enter start time:");
                   System.out.flush();
                   startTime = Integer.parseInt(stdin.readLine());
                   oneReservation.setstartTime(startTime);
                   System.out.println("Please enter end time:");
                   System.out.flush();
                   endTime = Integer.parseInt(stdin.readLine());
                   oneReservation.setendTime(endTime);
                   System.out.println("Please enter comments, if any:");
                   System.out.flush();
                   comments = stdin.readLine();
                   oneReservation.setComments(comments);
                   count++;
              while (count<1);
              class Reservation
              private Reservation oneReservation;
              private String custName, comments;
              private int covers, startTime, endTime, date;
              //Default constructor
              public Reservation()
              public Reservation(String custName, int covers, int date, int startTime, int endTime, String comments)
                   this.custName=custName;
                   this.covers=covers;
                   this.date=date;
                   this.startTime=startTime;
                   this.endTime=endTime;
                   this.comments=comments;
              //Setter methods
              public void setcustName(String custName)
                   this.custName=custName;
              public void setCovers(int covers)
                   this.covers=covers;;
              public void setDate(int date)
                   this.date=date;
              public void setstartTime(int startTime)
                   this.startTime=startTime;
              public void setendTime(int endTime)
                   this.endTime=endTime;
              public void setComments(String comments)
                   this.comments=comments;
              //Getter methods
              public String getcustName()
                   return custName;
              public int getCovers()
                   return covers;
              public int getDate()
                   return date;
              public int getstartTime()
                   return startTime;
              public int getendTime()
                   return endTime;
              public String getComments()
                   return comments;
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    class searchBooking
         static BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
         public static void main (String[]args)throws IOException
              int choice, date, startTime;
              String custName;
                   //Search Menu
                   System.out.println("Search By: ");
                   System.out.println("1. Date");
                   System.out.println("2. Name of Customer");
                   System.out.println("3. Date & Name of Customer");
                   System.out.println("4. Date & Start time of reservation");
                   System.out.println("5. Date, Name of customer & Start time of reservation");
                   System.out.println("Please make a selection: ");          
                   //User keys in choice
                   System.out.flush();
                   choice = Integer.parseInt(stdin.readLine());
                   if (choice==1)
                        System.out.println("Please key in Date (DDMMYY):");
                        System.out.flush();
                        date = Integer.parseInt(stdin.readLine());
                   else if (choice==2)
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                   else if (choice==3)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                   else if (choice==4)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Start time:");
                             System.out.flush();
                             startTime = Integer.parseInt(stdin.readLine());
                   else if (choice==5)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                             System.out.println("Please key in Start time:");
                             System.out.flush();
                             startTime = Integer.parseInt(stdin.readLine());
                        }

    Please stop calling your questions urgent. Everybody's question is urgent to them. Nobody's are urgent to the people who are going to answer them. Calling your questions urgent suggests that you think they are more important than others' (They're not.) and will only serve to irritate those who would help you. It won't get your questions answered any sooner.

Maybe you are looking for

  • How do I change the iTunes account affiliated with my device?

    When I unpackaged my iPhone 4 at home, I put music on it with my sister's iTunes account, I did not have one. Now that I have my own, I can't add music to my device, because I can only have one iTunes account registered to my phone. How do I change i

  • Displaying error messages in table...

    Hi All, How can we display error messages in a table in a bsp page. I am filling an internal table in OnInputProcessing on some event with all the error messages to be displayed. Table sould have two columns 1)Graphic depending on error type. 2)Error

  • Inspire 5200 5.1 Freaky!!!!

    Just wondering if anyone else has ever had a problem with their speakers making strange noises, as in voices. I know sounds crazy but me and my roommate have both heard them. The other night i heard a strange noise coming from just one speaker next t

  • Problems with creation of views and indexes....but the connection is nice!!

    Hi everyone. I'm running a SQLServer7 migration using migration workbench. The only objects to migrate are: tables, users: views: indexes and foreign keys. It seesm to go fine with the migration, thus workbench is both connected to the SQLServer and

  • Changing OPS$ passwd during system refresh

    Hi All, i have to do system Refresh/system copy ,i m using oracle 10g database. while studying the docs and sap notes,i found that after database is backed from source system and restored in target system .It is also required to change some passwords