jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes passing message between two programs(.java files) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "passing message between two programs(.java files)" Watch "passing message between two programs(.java files)" New topic
Author

passing message between two programs(.java files)

arun shanmugam kumar
Greenhorn

Joined: Apr 02, 2005
Posts: 25
There are two .java files . I want to create an object of one class(which is in one .java file ) in the other class (which is in another .java file).
How to go about it?

ex:
//file Class1.java
public class Class1{

public static void main(String[] args)
{
}

}

//file Class2.java

public class Class2{

public static void main(String[] args)
{

Class1 obj=new Class1();
}

}

But it is giving a compile error?
Please help me .
Thanx in advance.
Phil Dixon
Greenhorn

Joined: Aug 13, 2005
Posts: 11
Arun,

Try this





[ September 27, 2005: Message edited by: Phil Dixon ]
[ September 27, 2005: Message edited by: Phil Dixon ]
Keith Pitty
Ranch Hand

Joined: Sep 22, 2005
Posts: 32
What does the compile error say?
arun shanmugam kumar
Greenhorn

Joined: Apr 02, 2005
Posts: 25
Thanx phil.
It works fine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing message between two programs(.java files)
 
Similar Threads
Issue when compiling a class which is importing a package
Creating an instance of a sub-class runs parent and child constructors?
call to JTextArea.getText() is not getting current text
Accessing component from main class.... Help!
Overriding