Unverified Commit 24c60f4b authored by Lokesh Singh's avatar Lokesh Singh Committed by GitHub

Create Second.java

parent 926fc426
public class Second {
public static void main(String[] args) {
Main obj = new Main();
System.out.println("Value of x is" + obj.x); // 5
}
}
// object created for main class to beacuse we want to access the members of main class in second class.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment