Created
November 27, 2016 10:11
-
-
Save jayjaykim/c076b8df09720303771e600b825fdbf0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by jayjay on 2016. 11. 27.. | |
*/ | |
public class AbstractClass { | |
public static void main(String[] args) { | |
NormalClass obj1 = new NormalClass(); | |
// SomeInterface obj2 = new SomeInterface(); | |
// SomeAbstractClass obj3 = new A;bstractClass() | |
SomeInterface obj2 = new SomeInterface() { | |
@Override | |
public void method1() { | |
} | |
@Override | |
public void method2() { | |
} | |
}; | |
SomeAbstractClass obj3 = new SomeAbstractClass() { | |
@Override | |
void method1() { | |
} | |
}; | |
} | |
// JAVA7 기준. Interface의 모든 메소드는 기본적으로 abstract method이다. | |
interface SomeInterface { | |
void method1(); | |
public abstract void method2(); | |
} | |
static abstract class SomeAbstractClass { | |
abstract void method1(); | |
void method2() { | |
} | |
} | |
static class NormalClass { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment