Page 2 of 2 FirstFirst 12
Results 21 to 26 of 26
  1. #21
    newbeliever is offline Member
    Join Date
    Mar 2011
    Posts
    12
    Rep Power
    0

    Default

    Yes, where d i instantiate the new class?..I instantiate the new class in main method?? Can I still use the QuestionData class in my program?...Where to write the questions in your class?..Thanks,..:(

  2. #22
    subith86 is offline Senior Member
    Join Date
    Jan 2011
    Location
    Bangalore, India
    Posts
    102
    Rep Power
    0

    Default

    Yes, It has to be instantiated in the main method of your class.

    I hope QuestionData class contains the question number mapped to the actual question. Or you decide some way that in your GUI, if the user selects an answer, the backend of your program should some how be able to identify the question for which the user has answered. This is enough. In your main method, get the corresponding question number for your question and the corresponing choice entered by the user. This much information is enough for PointsTable class.

    Now, I assume, the main method we are talking about can be in QuestionData or a new third class. You still haven't mentioned it yet. Having it in a third class is a better design. In this case, you have to create 2 instances, 1 of QuestionData and 1 of PointsTable.

    Still if you are not getting what I'm saying, I'd suggest you better spend some time (or days) to learn the basics and then start writing the code.:o

  3. #23
    newbeliever is offline Member
    Join Date
    Mar 2011
    Posts
    12
    Rep Power
    0

    Default

    I will create a third class for this, i know its difficult for me to do this...sir, do you have any reference on what books I'm going to study?..thanks

  4. #24
    subith86 is offline Senior Member
    Join Date
    Jan 2011
    Location
    Bangalore, India
    Posts
    102
    Rep Power
    0

  5. #25
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    If the OP hasn't learnt about Hashtable or Collections in general then suggesting that as a solution might not be the correct approach.

  6. #26
    newbeliever is offline Member
    Join Date
    Mar 2011
    Posts
    12
    Rep Power
    0

    Default

    Thank you very much sir...but I think it is not a basic in java topic..Hope to learn some basic more.....

Page 2 of 2 FirstFirst 12

Similar Threads

  1. convert byte array into char array
    By kgkamaraj in forum New To Java
    Replies: 4
    Last Post: 09-13-2011, 12:32 PM
  2. Replies: 23
    Last Post: 09-07-2010, 09:12 PM
  3. Replies: 2
    Last Post: 09-06-2010, 02:03 AM
  4. Convert Char Array to String Array
    By Mayur in forum New To Java
    Replies: 8
    Last Post: 10-12-2009, 12:41 PM
  5. Replies: 1
    Last Post: 03-31-2009, 07:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •