Test on JAVA test P7

  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. >>>
4 ★ | 2 Vote

May be interested

  • What test you know about operating system P13Photo of What test you know about operating system P13
    a set of multiple-choice operating system questions that help readers re-examine their knowledge and contribute positively to your work. the set of questions consists of 15 sentences with many different topics, invite readers to try.
  • Multiple choice questions about network security implementation have the answer P5Photo of Multiple choice questions about network security implementation have the answer P5
    network security is extremely necessary for anyone. in this article, join the network administrator to learn about this topic through multiple-choice questions below.
  • You have confidence in your knowledge of Network Administration P7Photo of You have confidence in your knowledge of Network Administration P7
    multiple choice questions about network administration give you useful knowledge about this topic. invite readers to consult and test their knowledge.
  • Test basic understanding of computersPhoto of Test basic understanding of computers
    in the age of technology 4.0 today, computers are a great tool for people in work and entertainment. you can sit next to the computer for hours to work. however, are you sure you master the basics of computers? let's try with the multiple choice questions below.
  • Test your understanding of P2 hackPhoto of Test your understanding of P2 hack
    the network administrator's quiz below will help you gain the knowledge to start your career as a hacker. the question set has only 2 answers, you just need to answer right or wrong.
  • JAVA P8 test quizPhoto of JAVA P8 test quiz
    if you are interested in learning about the java programming language, the following quiz of network administrator will provide you with a lot of useful knowledge for your learning.