Skip to content

Instantly share code, notes, and snippets.

@the-cybersapien
Created August 12, 2017 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-cybersapien/c7ddbb4bda6383cac21c708e5a884b25 to your computer and use it in GitHub Desktop.
Save the-cybersapien/c7ddbb4bda6383cac21c708e5a884b25 to your computer and use it in GitHub Desktop.
Java Class Demo
abstract class Calculate {
abstract int add(int a, int b);
}
public class Main{
public static void main(String[] args){
int result = new Calculate(){
@Override
int add(int a, int b){
return a+b;
}
}.add(11010, 22011);
System.out.println(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment