Skip to content

Instantly share code, notes, and snippets.

@jeserkin
Last active January 24, 2018 22:33
Show Gist options
  • Select an option

  • Save jeserkin/86152ebb75e32b26b04384f45105648c to your computer and use it in GitHub Desktop.

Select an option

Save jeserkin/86152ebb75e32b26b04384f45105648c to your computer and use it in GitHub Desktop.
public class MyClass {
public static void main(String args[]) {
Example.runExample();
AnotherExample.runExample();
}
}
class Example {
private String brand;
private boolean name;
public static void runExample() {
Example example = new Example();
System.out.println("Sum of x+y = " + example.brand); // this.brand
System.out.println("Sum of x+y = " + example.name); // this.name
}
}
class AnotherExample {
public static void runExample() {
Example example = new Example();
System.out.println("Sum of x+y = " + example.brand);
System.out.println("Sum of x+y = " + example.name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment