online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
class A { B obj; // Parameterized constructor with object of B as a parameter A(B obj) // 4 { this.obj = obj; // 5 // calling display method of class B obj.display(); // 6 } } class B { int x = 5; // Default Contructor that create a object of A with passing this as an argument in the constructor B() // 2 { A obj = new A(this); // 3 } // method to show value of x void display() // 7 { System.out.println("Value of x in Class B is " + x); // 8 } public static void main(String[] args) { B obj = new B(); } } public class Main { public static void main(String[] args) { B obj = new B(); // 1 } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue