Results 1 to 7 of 7
  1. #1
    j2vdk's Avatar
    j2vdk is offline Member
    Join Date
    Aug 2008
    Posts
    45
    Rep Power
    0

    Exclamation help-executing the program

    if my program has 3 classes, then can i write my each class in seperate notepad, then how to link my 3 files an execute it,

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,453
    Rep Power
    25

    Default

    Do you know how to do it if all three classes are in the same file?
    The compiler will create a separate class file for each class.
    Are the classes in a package?
    What have you tried so far?
    Copy and paste the full text of any error messages here.

  3. #3
    j2vdk's Avatar
    j2vdk is offline Member
    Join Date
    Aug 2008
    Posts
    45
    Rep Power
    0

    Default

    im writing a program with 3 classes in single .java file,,,, then how 3 class files created,,, only one class file are created,,,,,

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by j2vdk View Post
    im writing a program with 3 classes in single .java file,,,, then how 3 class files created,,, only one class file are created,,,,,
    No. When the classes are compiled, each class will placed into it's own file, including anonymous inner classes, and other (for the beginner) somewhat obscure constructs. You have only one java (i.e. source code) file, but three class (i.e. byte code/compiled/binary/however you want to refer to them) files.

  5. #5
    j2vdk's Avatar
    j2vdk is offline Member
    Join Date
    Aug 2008
    Posts
    45
    Rep Power
    0

    Default

    Quote Originally Posted by masijade View Post
    No. When the classes are compiled, each class will placed into it's own file, including anonymous inner classes, and other (for the beginner) somewhat obscure constructs. You have only one java (i.e. source code) file, but three class (i.e. byte code/compiled/binary/however you want to refer to them) files.
    but i see only one class file,,,, near by java file

  6. #6
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Find a tutor, because you have a basic misunderstanding here, and it is not something we will be able to solve either effeciently, nor effectively on a forum, like this.

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,453
    Rep Power
    25

    Default

    Can you post your code? Each class definition in a .java file will produce a separate .class file.
    Do you know how to define a class?
    Are you defining classes or just creating instances of classes defined somewhere else?

Similar Threads

  1. Executing a jar file
    By peiceonly in forum New To Java
    Replies: 7
    Last Post: 02-14-2014, 09:02 AM
  2. Executing a program within a program
    By gibsonrocker800 in forum New To Java
    Replies: 5
    Last Post: 05-12-2008, 08:24 AM
  3. Problem with executing
    By mcal in forum New To Java
    Replies: 2
    Last Post: 02-09-2008, 01:51 PM
  4. Executing Batch
    By zcoarens in forum New To Java
    Replies: 0
    Last Post: 08-14-2007, 09:49 AM
  5. Executing Ant code pragramatically
    By MikeO in forum Advanced Java
    Replies: 0
    Last Post: 07-24-2007, 09:34 PM

Posting Permissions

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