wood burning stoves 2.0
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 Building Microservices this week in the Design 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:-

1) p1.java

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

2) p2.java

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


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

Joined: Oct 15, 2011
Posts: 250

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
Have you checked out Aspose?
subject: Getting output of other class.
It's not a secret anymore!