개요
Java
Copy
public class MyClass {
public static class Dog {
private String name;
public Dog(String name) {
this.name = name;
}
public void bark() {
System.out.println("Woof!");
}
}
public static void main(String args[]) {
Dog mydog = new Dog("snoopy");
mydog.bark();
}
}
Loading
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.