JAVA 프로그래밍/Do it! 자바 프로그래밍 입문
classpart/StudentTest1.java
불두화
2021. 5. 13. 13:46
이전까지 했던 책의 예제들 업로드합니다.
감사합니다.
package classpart;
public class StudentTest1 {
public static void main(String[] args) {
Student student1 = new Student( );
student1.studentName = "안연수";
System.out.println(student1.getStudentName( ));
Student student2 = new Student( );
student2.studentName = "안승연";//참조변수 사용 .studentName
System.out.println(student2.getStudentName( ));//메서드 사용(getStudentName( )))
}
}