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

Đoạn chương trình sau sai ở dòng lệnh nào?

13/27

Đoạn chương trình sau sai ở dòng lệnh nào?

<%

HttpSession s=request.getSession(true); if(s.isNew==true)

{

Integer visitors = new Integer(0); s.setAttribute("counter", visitors);

}

Integer visitors =(Integer) s.getAttribute("counter");

%>

</%

Lệnh 1

Lệnh 2

Lệnh 4

Lệnh 5

Giải thích

Chọn đáp án B