|
-
September 29th, 1999, 06:42 AM
#4
Re: Memeber Class
OK
If you want to create an instance of a class, than you need at first another class. So if you want to try it, than you can to it like that:
Make a File named Test1.java
in that one you just write
public class Test1
{
int Number1;
int Number2;
}
than you create a second file named Test2.java
there you write:
public class Test2
{
public static void main (String args[])
{
Test1 a = new Test1();
a.Number1 = 5;
}
}
So you have created an instance of the class Test1 named a. Every class must be a own file ! ! !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|