Test on JAVA test P5
- 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;
}- Van, Toan
- Flowers, Ly
- Immediately
- There is no answer
-
- 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;
}- Van, Toan
-
Flowers, Ly
-
- Immediately
- There is no right answer
-
- 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;
}- Van, Toan
- Flowers, Ly
- Immediately
- There is no right answer
-
- 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);
-
Quick page
-
black
- Quickly
- There are no colors in the list
-
- 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);- black
- Blue
- Quick page
- Quickly
-
- 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);- 45
- 0
- 55
- No results were correct
-
- 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);- Enter data for the raw array.
- Calculate the total integer array.
- Enter data and calculate the integer array.
-
All is wrong
-
- 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);-
- S = 40
-
- S = 50
- S = 55
-
S = 45
-
- 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);- Wrong command
- S = 10
-
- S = 45
-
- S = 55
-
- 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);- i = 0
- i = 1
- i = 2
- All is wrong
-
4 ★ | 2 Vote
You should read it
May be interested
- P13 programming set of multiple choice questionsyou are a fan of programming languages and want to learn more about this topic. to give you an interesting reading about programming, in this article, the network administrator will send you a good quiz about this topic. invite your reference.
- What test you know about operating system P11please read your knowledge and the following multiple choice questions of network administrator. hope with these questions will give you lots of useful information.
- Are you confident with your Network Administration knowledge P6please read our below knowledge and network admin questions. the question set will have 12 sentences for you to try.
- Multiple choice questions about Photoshop P17in addition to mastering the skills, you also need to supplement yourself with useful knowledge when working with photoshop. in the quiz below, join the network administrator and learn and play with the following interesting questions.
- JAVA test on P6multiple choice questions about java programming give you useful knowledge. if you love java programming, don't skip the series of interesting tests below by network administrator.
- Set of multiple choice questions on programming with P14 prizeyou are a regular person writing about programming code, so are you confident with your knowledge? try checking with our multiple choice questions below.