TOP 20 câu hỏi trắc nghiệm ôn tập học phần Computer Science | Trường Đại học Quốc tế, Đại học Quốc gia Thành phố Hồ Chí Minh
Like C++, Java requires that you delete objects from memory when you are finished with that object? Object-oriented (OO) programming can improve programmer efficiency, compared to non-OO programming? All the following statements are rules of constructor chaining except? Overloaded constructors must have different signatures. The compiler chooses the constructor to call based on the constructor signature? Tài liệu giúp bạn tham khảo, ôn tập và đạt kết quả cao. Mời bạn đón xem.
Môn: Computer Science
Trường: Trường Đại học Quốc tế, Đại học Quốc gia Thành phố Hồ Chí Minh
Thông tin:
Tác giả:
Preview text:
Constructors can be overloaded. Question 1 options: True False Question 2 (1 point)
Like C++, Java requires that you delete objects from memory when you are finished with that object. Question 2 options: True False Question 3 (0.5 points)
Object-oriented (OO) programming can improve programmer efficiency, compared to non-OO programming. Question 3 options: True False Question 4 (0.5 points)
It is possible - and possibly good programming - to make methods private. Question 4 options: True False Question 5 (1 point)
All the following statements are rules of constructor chaining except: Question 5 options:
Use the this() expression as the first line of the constructor
There must be one constructor in the class
There must be at least one constructor without this() expression
All of the above answers are correct Question 6 (1 point)
Overloaded constructors must have different signatures. The compiler chooses the constructor to call
based on the constructor signature. Question 6 options: True False Question 7 (1 point)
Objects are just software and can't do things like attributes and behaviours. Question 7 options: True False Question 8 (1 point)
Which Boolean operator is not used in Java programming? Question 8 options: NOT AND XOR OR Question 9 (1 point)
All of the following are main concepts of object-oriented programming except: Question 9 options:
encapsulation and polymorphism procedural programming
All of the answers in A and B are correct
None of the answers in A and B are correct Question 10 (1 point)
Object-oriented programming allows you to implement an object-oriented design as a working
system. Java is only partly object-oriented. Question 10 options: True False Question 11 (1 point)
Java math follows a set order of operations identical to algebra. Question 11 options: True False Question 12 (1 point)
Consider the code: for (int i=0;i<6;i++) { i++; //other code } Is there a better way to make a for
loop that counts by values of 2? Question 12 options: True False
Question 13 (0.5 points) You can show operations in a UML diagram by listing the name of the
operation and then a set of parentheses. (Parentheses are the round brackets.) Question 13 options: True False
Question 14 (2 points) Question 14 options: Same return type name Number of parameters All of the above are correct Question 15 (2 points) Question 15 options:
Correct and can be used in the program
Wrong and cannot be used in the program
Correct, but can only be used as fields
Correct, but will only compile in some versions of Java Question 16 (1 point)
As a good programmer you can assume that users are always friendly, use your software flawlessly,
and never enter bad values. Question 16 options: True False Question 17 (0.5 points)
An object is referred to as an instance of a its class. A class can only have one special method called a
constructor that instantiates an object. Question 17 options: True False
Question 18 (1 point) Java requires a constructor call only for large objects. Small objects never use no constructors. Question 18 options: True False Question 19 (1 point)
Constructor chaining can only happen in a specific order. Question 19 options: True False Question 20 (1 point)
"Constructor chaining" is the term for when you call constructors from outside the class. Question 20 options: True False