Poll: Core java Fundamentals 1.2

2, Which one of these lists contains only Java programming language keywords?

  • A. class, if, void, long, Int, continue
  • B. goto, instanceof, native, finally, default, throws
  • C. try, virtual, throw, final, volatile, transient
  • D. strictfp, constant, super, implements, do
  • E. byte, break, assert, switch, include
4 Likes

D. strictfp, constant, super, implements, do

1 Like

Nhầm nhọt rồi nhé. :))

1 Like

C. try, virtual, throw, final, volatile, transient :smile:

Vẫn sai rồi. hè. Trong Java k có keyword virtual. hehe

Constant k phải keywork, nó dùng tạo static hay final

Theo em là câu A. (ai đó đoán 1 cái nữa đi)

1 Like

A.	class, if, void, long, Int, continue  // Int 
B.	goto, instanceof, native, finally, default, throws  
C.	try, virtual, throw, final, volatile, transient  // virtual
D.	strictfp, constant, super, implements, do // strictfp
E.	byte, break, assert, switch, include //include  

:smiley:

3 Likes

Đáp án D là constant không đúng. Trong java có keyword strictfp

strictfp class A{}

Trắc nghiệm bạn vẫn đc điểm (y)

1 Like

Đáp án:
[spoiler]All the words in option B are among the 49 Java keywords. Although goto reserved as a keyword in Java, goto is not used and has no function.

Option A is wrong because the keyword for the primitive int starts with a lowercase i.

Option C is wrong because “virtual” is a keyword in C++, but not Java.

Option D is wrong because “constant” is not a keyword. Constants in Java are marked static and final.

Option E is wrong because “include” is a keyword in C, but not in Java.[/spoiler]

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?