100+ câu trắc nghiệm Phát triển ứng dụng Web có đáp án - Phần 3

Giả sử đã có TimeBean như sau: public class TimeBean implements Serializable {private int hours, minutes, seconds; public TimeBean(){hours =minutes=seconds=0;}public int getHours(){return hou

15/27

Giả sử đã có TimeBean như sau: public class TimeBean implements Serializable {

private int hours, minutes, seconds; public TimeBean()

{

hours =minutes=seconds=0;

}

public int getHours()

{

return hours;

}

public void setHours(int h)

{

if(h>=0 && h <24)hours=h;

}

}

Hãy cho biết đoạn mã sau trong trang JSP sẽ hiển thị gì trên trình duyệt?

 

 

 

</24)hours=h;

0

10

Giờ hiện tại

Lỗi, không hiển thị gì

Giải thích

Chọn đáp án B