Creating Class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maykut
    New Member
    • Nov 2006
    • 9

    #1

    Creating Class

    Hi everybody!
    I have a problem with creating classes in a java source code.I don't know is it possible. creating an non-existing class and filling it with its constructor in another java source code?After all creating an object from my new class.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by maykut
    Hi everybody!
    I have a problem with creating classes in a java source code.I don't know is it possible. creating an non-existing class and filling it with its constructor in another java source code?After all creating an object from my new class.
    A constructor for a class must exist in that class. A java class cannot span to more than one source file. Therefore you cannot write a class in one source file and write its constructor in another source file.
    You can only call the constructor in another source file not define it there.

    Comment

    Working...