- Fixed the error about java class version in vscode
- Learned the basic examples of java.
test.java
public class test{
public static void main(String[] ar) {
Tiger tiger1 = new Tiger();
System.out.println("The adoption of the tiger1");
System.out.println("Name : " + tiger1.name + "Sound : " + tiger1.cry + "Behavior : " + tiger1.behavior);
Dog dog1 = new Dog();
System.out.println("The adoption of the dog1");
System.out.println("Name : " + dog1.name + "Sound : " + dog1.cry + "Behavior : " + dog1.behavior);
}
}
Tiger.java
public class Tiger {
String name = "Hodol. ";
String cry = "Wow!. ";
String behavior = "Move fast and heavy. ";
}
Dog.java
public class Dog {
String name = "Snoopy. ";
String cry = "bark!. ";
String behavior = "shake its tail. ";
}
'Footstep . 발자취' 카테고리의 다른 글
2020-02-15-My footstep (0) | 2020.03.16 |
---|---|
2020-02-14-My footstep (0) | 2020.03.16 |
2020-02-11-My footstep (0) | 2020.03.16 |
2020-02-08-My footstep (0) | 2020.03.16 |
2020-02-07-My footstep (0) | 2020.03.16 |