Test on JAVA test P7
A set of multiple-choice questions about Java gives you useful knowledge for work and study. The set of questions below includes 10 sentences for you to experience.
- 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?
- !
- >>
- <<
- >>>
-
Discover more
tutorial multiple choice test JAVA programming eQuiz knowledge basic technical optimization language java programmingShare by
Isabella Humphrey
Update 24 May 2019
You should read it
- Test on JAVA test P5
- JAVA test test P1
- JAVA test on P3
- Testing test on JAVA P2
- JAVA P8 test quiz
- The Quiet Details That Make a Sports Betting Platform Feel Reliable
- Instructions on creating toy set images with ChatGPT AI
- How are AI agents changing the journalism industry?
- What test you know about operating system P13
- Multiple choice questions about network security implementation have the answer P5
- You have confidence in your knowledge of Network Administration P7