다음 코드는 베이츠와 시에라에서입니다 :이 참조는 왜 null입니까?
public class Book {
private String title; // instance reference variable
public String getTitle() {
return title;
}
public static void main(String [] args) {
Book b = new Book();
String s = b.getTitle(); // Compiles and runs
String t = s.toLowerCase(); // Runtime Exception!
}
}
String t = s.toLowerCase()
원인 런타임 예외 String s = b.getTitle()
하지 않는 않는 이유는 무엇입니까?
후 오류 로그를도. –
와우, 5 분 안에 5 개의 답변 .. – micha