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.

  1. Question 1. Which method is used to search a string in another string in Java's String class?
    1. astIndexOf ()
      1. substring ()
      1. toString ()
    2. No answer right
  2. Question 2. In Java, what data type is an object's address or an array created in memory?
    1. Primitive type
    2. Reference type
    3. Format
    4. There is no right answer
  3. Question 3. What is the function of the while loop?
    1. Check the result of the boolean expression
    2. Avoid conflict between inside and outside the switch
    3. Repeat the command block to see if the condition is correct
    4. No answer right
  4. 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?
    1. break
    2. tiếp tục
    3. thay đổi
    4. jump
  5. Question 5. Result = condition command? What does value1: value2 mean?
      1. If condition is true then result = value2, if condition is false, result = value1
    1. If condition is true then result = value1, if condition is false then result = value2
    2. There is no such command
    3. If condition is true, the result will invert the value of value1 and value2
  6. Question 6. Which command stops the current loop and starts the next loop?
    1. tiếp tục
    2. break
    3. cease
    4. end
  7. Question 7. Which of the following statements is correct?
    1. int [] a;
    2. int a [];
    3. int a [] = new int [10];
    4. All 3 statements are correct
  8. 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;
    1. first
    2. 2
    3. 3
    4. 4
  9. 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 ());

    }

    }
    1. MyRect has not been initialized yet
    2. There is no processing method
    3. There is no static keyword
    4. The program is not wrong
  10. Question 10. To inverse the value of a boolean variable, which operator do we use?
    1. !
    2. >>
    3. <<
    4. >>>
Update 24 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile