aspose file tools*
The moose likes Beginning Java and the fly likes Insert 2nd class tu main class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Insert 2nd class tu main class" Watch "Insert 2nd class tu main class" New topic

Insert 2nd class tu main class

nani aman
Ranch Hand

Joined: Sep 22, 2004
Posts: 33

i have a bug in my mind,i think. I create a program in 2 class which have their own operation. the 1st class in the main class which i want to have the second class in the first class. How can i link the second class to the main class? In my second class i have a variable that i want to insert in main class. Can i send by click a button in second class, but how?

Please assist me.
Thank you.
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

Why not have the class with the main() method simply load the second class?

Seems to me from here "main" can do as it pleases, barring any little scoping restrictions you've put in the way so life can be harder for you.

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
nani aman
Ranch Hand

Joined: Sep 22, 2004
Posts: 33
is there any include class file in the header like C++?
It is sorta covered in the JavaRanch Style Guide.
subject: Insert 2nd class tu main class
Similar Threads
can get label on second line
Calling main method
How do i set a value in a jsp and get the same value in a servlet?
how to pass command line arguments
Using custom panel in NetBeans GUI builder