Test on JAVA test P5

  1. Question 1. How much of the above block will result if we enter revenue = 1?
     switch (receiver) { 

    case 2:

    System.out.println ('Van, Toan');

    break;

    case 3:

    System.out.println ('Flowers, Cups');

    break;

    default:

    System.out.println ('Immediately');

    break;

    }
    1. Van, Toan
    2. Flowers, Ly
    3. Immediately
    4. There is no answer
  2. Question 2. How much will the above block result if we enter revenue = 2?
     switch (receiver) { 

    case 2:

    System.out.println ('Van, Toan');

    break;

    case 3:

    System.out.println ('Flowers, Cups');

    break;

    default:

    System.out.println ('Immediately');

    break;

    }
    1. Van, Toan
    2. Flowers, Ly

      1. Immediately
    3. There is no right answer
  3. Question 3. How much of the above block will result if we enter revenue = 3?
     switch (receiver) { 

    case 2:

    System.out.println ('Van, Toan');

    break;

    case 3:

    System.out.println ('Flowers, Cups');

    break;

    default:

    System.out.println ('Immediately');

    break;

    }
    1. Van, Toan
    2. Flowers, Ly
    3. Immediately
    4. There is no right answer
  4. Question 4. If color = DEN, what is the above command to print the result?
     mausac enum {DEN, LAM, LUC, PAGE}; 

    mausac color;

    char * t;

    switch (color) {

    case 0:

    t = 'Mau page';

    break;

    case 1:

    t = 'Mau den';

    break;

    case 2:

    t = 'Mau lam';

    break;

    case 3:

    t = 'Mau luc';

    break;

    default:

    t = 'Not in the list';

    break;

    }
     System.out.println (t); 
    1. Quick page

    2. black

    3. Quickly
    4. There are no colors in the list
  5. Question 5. If color = DEN, what is the above command to print the result?
     enum mausac {DEN = 3, LAM, LUC, PAGE}; 

    mausac color;

    char * t;

    switch (color) {

    case 0:

    t = 'Mau page';

    break;

    case 1:

    t = 'Mau den';

    break;

    case 2:

    t = 'Mau lam';

    break;

    case 3:

    t = 'Mau luc';

    break;

    default:

    t = 'Not in the list';

    break;

    }

    System.out.println (t);
    1. black
    2. Blue
    3. Quick page
    4. Quickly
  6. Question 6. When executing the above block, what is the result?
     int s = 0; 

    for (int i = 0; i <10; i ++)

    s + = i;

    System.out.println (s);
    1. 45
    2. 0
    3. 55
    4. No results were correct
  7. Question 7. What does this block do?
     int [] mang = new int [10]; 

    int s = 0;

    int j = 0;

    for (int i: mang) {

    i = ++ j;

    s + = i;

    }

    System.out.println ('S =' + s);
    1. Enter data for the raw array.
    2. Calculate the total integer array.
    3. Enter data and calculate the integer array.
    4. All is wrong

  8. Question 8. When executing the command block in the figure, what will be the result?
     int [] mang = new int [10]; 

    int s = 0;

    int j = 0;

    for (int i: mang) {

    i = ++ j;

    s + = i;

    }

    System.out.println ('S =' + s);
      1. S = 40
      1. S = 50
    1. S = 55
    2. S = 45

  9. Question 9. When executing the above block, what is the result?
     int [] mang = new int [10]; 

    int s;

    int j = 0;

    for (int i: mang) {

    s = 0;

    i = ++ j;

    s + = i;

    }

    System.out.println ('S =' + s);
    1. Wrong command
    2. S = 10
      1. S = 45
      1. S = 55
  10. Question 10. When executing the block, what is the result?
     int i = 0; 

    due to {

    i + = 1;

    } while (i == 0);

    System.out.println ('i =' + i);
    1. i = 0
    2. i = 1
    3. i = 2
    4. All is wrong
4 ★ | 2 Vote

May be interested

  • Test on JAVA test on P9Test on JAVA test on P9
    unlike most common programming languages, instead of compiling the source code into machine code or interpreting source code when running, java is designed to compile the source code into bytecode, then bytecode will be run by the runtime environment. . to help you better understand this programming language, the following quiz of network administrator will give you lots of useful knowledge.
  • Get familiar with NetBeans Java IDEGet familiar with NetBeans Java IDE
    in the following article, we will introduce you the most basic features of netbeans ide through a small test, which is to create the 'hello world' java application. and when finished, you will know the general knowledge and process when programming applications in ide ...
  • Testing test on JAVA P2Testing test on JAVA P2
    multiple choice questions on java programming help you test your basic knowledge of this programming language. the set of questions includes 10 sentences to try.
  • JAVA P8 test quizJAVA 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.
  • Basic Java syntaxBasic Java syntax
    a java program can be defined as a collection of objects, communicating through calling each other's procedures. now we will look at the class, object, procedure and instance variable / instance variable to consider their meaning.
  • eQuiz - Multiple choice test on Java Swing PracticeeQuiz - Multiple choice test on Java Swing Practice
    welcome to the test series of tipsmake.com with topics related to the fields of information technology. and this time we will continue with the java swing practice test, a total of 13 questions will be answered with no time to answer each sentence. there will be some questions with many different answer options
  • What is JAVA file? How to open, edit and convert JAVA filesWhat is JAVA file?  How to open, edit and convert JAVA files
    a file with a .java extension is (or sometimes also used in .jav format) is a java source file written in the java programming language.
  • eQuiz - Multiple choice quiz about JAVAeQuiz - Multiple choice quiz about JAVA
    following are multiple-choice questions related to java programming language, there will be 23 questions in total with no answer for each time. let's get started!
  • Download and install Java on the computerDownload and install Java on the computer
    to program java on your computer, you need to install the java environment, this tutorial will show you how to download and install java on your computer.
  • Basic Java exercises, with sample decodingBasic Java exercises, with sample decoding
    to serve your java learning needs, tipsmake.com has synthesized some java exercises from many sources, including sample code (for some articles). hopefully it can be helpful to learn your java programming language.