online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
//to return the current class instance class demo { int a; int b; //Default constructor demo() { a = 10; b = 20; } //Method that returns current class instance // 3 demo get() { // 4. returns the instance of class demo return this; } //Displaying value of variables a and b void display() // 6 { System.out.println("a = " + a + " b = " + b); // 7 } } public class Main { public static void main(String[] args) { //1. create object of class demo demo object = new demo(); object.get().display(); // 2 // 5 } }

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