Can you do these 10 Java questions? Test your level
/**
*These 10 questions are all done by me. I have done them wrong or think they are valuable and need to be reviewed. I have compiled them to test everyone
*If you have better suggestions, please feel free to submit them.
*/
1. The code output result is
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
A.11 17 34
B.22 74 74
C .6 7 7
D.22 34 17
2. After the following program is compiled and run, the result displayed on the screen is ()
1 2 3 |
|
A .0
B.2
C.5
D.80
3. There is the following code: Please write the output result of the program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
A.432
B.531
C.421
D.523
4. What is the result of the following code?
1 2 3 4 5 6 7 8 9 10 11 12 |
|
A. The code can be compiled and run, and "AB.AB" will be output.
B. The code can be compiled and run, and "A.A" will be output.
C. The code can be compiled and run, and "AB.B" will be output.
D. The code can be compiled and run, and "A.B" will be output.
5. Given the following code, please give the result. 0608
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
A.null null 42
B.null 42 42
C.0 0 42
D.0 42 42
6. In the following code snippet, the statement with compilation error is ()
1 2 3 4 5 6 7 |
|
A. Statement 2
B. Statement 1
C. Statement 3
D. Statement 4
7.What will be printed when you execute the following code? 0611
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
A.BB
B.CBB
C.BAB
D.None of the above
8. After the following code is executed, the output result is ( ) 0611
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
A.hello and dbc
B.world and abc
C.hello and abc
D.world and dbc
9. The following code will print out
1 2 3 4 |
|
A.com. jd
B.com/jd/MyClass.class
C.///////MyClass.class
D.com.jd.MyClass
10. For the following The code segment
1 2 3 4 5 6 7 8 9 10 11 12 |
|
can be placed in the horizontal line position so that the program can compile and run correctly without generating errors. The option is ( )
A.public void foo(){}
B.public int foo(){return 1;}
C.public A foo(B b){return b;}
D.public A foo(){return A;}
Related articles:
Share a summary of interview questions in java
10 classic Java main method interview questions
Related videos:
The above is the detailed content of Can you do these 10 Java questions? Test your level. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

Solutions to convert names to numbers to implement sorting In many application scenarios, users may need to sort in groups, especially in one...

Field mapping processing in system docking often encounters a difficult problem when performing system docking: how to effectively map the interface fields of system A...

Start Spring using IntelliJIDEAUltimate version...

When using MyBatis-Plus or other ORM frameworks for database operations, it is often necessary to construct query conditions based on the attribute name of the entity class. If you manually every time...

Conversion of Java Objects and Arrays: In-depth discussion of the risks and correct methods of cast type conversion Many Java beginners will encounter the conversion of an object into an array...

Detailed explanation of the design of SKU and SPU tables on e-commerce platforms This article will discuss the database design issues of SKU and SPU in e-commerce platforms, especially how to deal with user-defined sales...

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...
