Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Insert 2nd class tu main class

 
nani aman
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
nani aman
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any include class file in the header like C++?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic