Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged

Sp7 #181

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions 56 Miscellaneous/Cpp/this_keyword_2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package Cpp;

class Function_that_returns_objects_2{

int value;

public Function_that_returns_objects_2(int value) {

this.value = value;

System.out.println("Inside constructors \n");
}


int get_value() {
return value;
}


// Return an object.
Function_that_returns_objects_2 mkBigger() {

Function_that_returns_objects_2 object = new Function_that_returns_objects_2(value * 2);

return object;

}

}


// It seems that a function cannot be declared in the global scope.
void display(Function_that_returns_objects_2 ob) {

System.out.println(ob.get_value());

}



static void display2(Function_that_returns_objects_2 ob) {

System.out.println(ob.get_value());

}



public class this_keyword_2 {

public static void main(String[] args) {
// TODO Auto-generated method stub

}

}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.