Last active
January 14, 2021 07:40
-
-
Save youngjinmo/15320152f54107007b03726162d34b06 to your computer and use it in GitHub Desktop.
instance of 연산자 실습 코드 (livestudy 3주차)
This file contains 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
public class Example01{ | |
Integer num = 20; | |
} |
This file contains 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
public class Example02 extends Example01 { | |
String greeting = "Hello"; | |
} |
This file contains 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
public class StudyHalle03 { | |
public static void main(String[] args) { | |
Arithmetic arithmetic = new Arithmetic(); | |
Example01 ex01 = new Example01(); | |
Example02 ex02 = new Example02(); | |
System.out.println((arithmetic instanceof Arithmetic)+"\n"); | |
System.out.println(ex01.num instanceof Integer); | |
System.out.println(ex02.greeting instanceof String); | |
System.out.println((ex01.num instanceof Object)+"\n"); | |
System.out.println(ex02 instanceof Example01); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment