-
Question 1. Which method is used to search a string in another string in Java's String class?
-
astIndexOf ()
-
- substring ()
-
- toString ()
-
No answer right
-
-
Question 2. In Java, what data type is an object's address or an array created in memory?
-
Primitive type
-
Reference type
-
Format
-
There is no right answer
-
-
Question 3. What is the function of the while loop?
-
Check the result of the boolean expression
-
Avoid conflict between inside and outside the switch
-
Repeat the command block to see if the condition is correct
-
No answer right
-
-
Question 4. Java provides a number of commands that change control flow based on conditions. Which command stops the operation of the inner lap and starts the next statement immediately after the block?
-
break
-
tiếp tục
-
thay đổi
-
jump
-
-
Question 5. Result = condition command? What does value1: value2 mean?
-
- If condition is true then result = value2, if condition is false, result = value1
-
If condition is true then result = value1, if condition is false then result = value2
-
There is no such command
-
If condition is true, the result will invert the value of value1 and value2
-
-
Question 6. Which command stops the current loop and starts the next loop?
-
tiếp tục
-
break
-
cease
-
end
-
-
Question 7. Which of the following statements is correct?
-
int [] a;
-
int a [];
-
int a [] = new int [10];
-
All 3 statements are correct
-
-
Question 8. How many changes of the array object reference and variable exist after executing the block?
String [] students = new String [10];
String studentName = 'Peter Parker';
students [0] = studentName;
studentName = null;-
first
-
2
-
3
-
4
-
-
Sentence 9. Assumption Rectangle class is defined and not false. When running, the program reported an error because:
public class SomeWrong {
public static void main (String [] args) {
MyRect Rectangle;
myRect.width = 40;
myRect.height = 50;
System.out.println ('Standard delivery:' + myRect.area ());
}
}-
MyRect has not been initialized yet
-
There is no processing method
-
There is no static keyword
-
The program is not wrong
-
-
Question 10. To inverse the value of a boolean variable, which operator do we use?
-
!
-
>>
-
<<
-
>>>
-
4 ★ | 2 Vote