Results 1 to 4 of 4
  1. #1
    jmd13 is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default class creator !! please read this thread

    i need to develop a Java application that generates Java classes from text
    files.
    A- the program should read the text files’ names as command line arguments.
    B- The input file describes the basic structure of a class and has the following format:
    # comment line
    Classname
    variableType variableName
    variableType variableName
    ...
    variableType variableName
    Notes re file format:
    · The character ‘#’ starts a comment which ends with the end of the line.
    · White space characters can appear at the beginning of a line of text and several such
    characters may separate a variable’s type from its name.
    C- For each input file, the program should generate a Java class file where:
    1- There is a constructor which has a parameter for each instance field.
    2- For every instance field, add mutator and accessor methods to the class.
    3- Add the toString method that returns a string which contains the data represented in
    each instance field on a separate line.
    4- Each method in the class must be preceded by a java-doc comment describing it.
    Also, generate the Java driver class that exercises all the methods of the class.


    ANY ONE HELP

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Hello, and welcome to the forum.

    So in essence what you've done is to give us your entire assignment without asking a question, and I'm afraid that in this situation there's not much that we can do for you other than to direct you to a tutorial or two.

    I suggest that you post your best solution that you've created so far, and ask as specific questions as possible, and we'll be much better able to help. If you really have no idea how to begin here, then please have a look here: Starting Writing a Program. It's a well-written article that can help.

    Much luck

  3. #3
    jmd13 is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default

    ok..
    i created my main method and a scanner in order to read the text files
    i just need to know what is the method in order to create a Java class during run-time
    thank you

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,773
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by jmd13 View Post
    ok..
    i created my main method and a scanner in order to read the text files
    i just need to know what is the method in order to create a Java class during run-time
    thank you
    I think your assignment wants you to create Java source code. You can invoke the compiler during runtime if you want to create a .class file aferwards.

    kind regards,

    Jos

Similar Threads

  1. change value in the in the creator class
    By livnihai in forum New To Java
    Replies: 8
    Last Post: 10-07-2009, 07:14 AM
  2. Gui Swing Creator
    By 2o2 in forum New To Java
    Replies: 4
    Last Post: 10-02-2008, 12:38 AM
  3. Using Scanner class to read int
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-18-2008, 12:50 PM
  4. Using Scanner class to read int value
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 10:34 AM

Posting Permissions

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