| Author |
How to call(load) other class,see my code
|
eric lee
Ranch Hand
Joined: Nov 04, 2002
Posts: 86
|
|
i have test.java and img.java.when i run test.java and click button(actionPerformed) to load img.java the compiler tell me wrong.below is my code. how to fix it? Thanks. [ edited to preserve formatting using the [code] and [/code] UBB tags -ds ] [ February 28, 2003: Message edited by: Dirk Schreckmann ]
|
 |
Peter Wong
Greenhorn
Joined: Feb 18, 2003
Posts: 8
|
|
|
At first you must use inheritance to extends img and also put them in the same folder then you must compile those .java
|
 |
eric lee
Ranch Hand
Joined: Nov 04, 2002
Posts: 86
|
|
Peter: why it got wrong when i compile with jdk1.4? error show:can not resolve the symbole. G hello=new G(); but it can compile in JBuilder environment and print "hi". what' wrong with my jdk 1.4? ------------------------------------------------ public class Test { public static void main (String[] args) { G hello = new G(); hello.greet(); } } ------------------------------------------------ public class G{ public void greet() { System.out.println("hi"); } }
|
 |
Peter Wong
Greenhorn
Joined: Feb 18, 2003
Posts: 8
|
|
But I couldn't get any error It is work properly So please download latest jdk version to compile  [ February 21, 2003: Message edited by: Peter Wong ]
|
 |
eric lee
Ranch Hand
Joined: Nov 04, 2002
Posts: 86
|
|
|
Thanks,peter
|
 |
 |
|
|
subject: How to call(load) other class,see my code
|
|
|