aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Getting output of other class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Getting output of other class." Watch "Getting output of other class." New topic

Getting output of other class.

rohit shekhar
Ranch Hand

Joined: Mar 05, 2010
Posts: 32
I was trying this...
In a common package (in eclipse) i placed two files as follows:-


public class p1 {
public static void main(String[] args)
p2 p = new p2();
class p2
void disp()
System.out.println("From class p2");


class p3
// strange!! execute this file we will get output of
class p4


if we will execute it shows output of
please explain.
Astha Sharma
Ranch Hand

Joined: Oct 15, 2011
Posts: 249

you might be using this command for execution-
java p2

Astha - OCPJP 6 (90%)
naveen yadav
Ranch Hand

Joined: Oct 23, 2011
Posts: 384

if you can please provide complete code with command line options
Don't get me started about those stupid light bulbs.
subject: Getting output of other class.