Java program basic test questions

Source: Internet
Author: User

Java BASIC program testing(Test time: 100 minutes, total score: 100 points) 1. Fill in the blanks (2 points per question, total 40 points) 1. write the binary, octal, and hexadecimal representation of number 17 respectively: ________________ write the-17 complement: _____________ 2. INT-type variables occupy ______ bytes in memory, and char-type variables occupy _____ bits in memory. 3. The basic development tools for the Java language are _____________ and the integrated development tools are ____________ 4. in JDK, the compilation commands for the Java language are ____________ and the execution commands for the Java language are _______. 5. it is known that the encoding of character a is 97, the encoding of uppercase character a is 65, and the encoding of uppercase and lowercase characters is continuous, then, the lowercase characters E and uppercase characters e are encoded in sequence: _____________ 6. write the result of the following expression: 1) 5% 6/3 2) True & false 3) 5> 34) 12 ^-47. modify the following code: 1) float F = 1.0; 2) Char c = 100000; 3) byte B = 200; 4) Long Int = 100; 8. read the following code and write the program execution result: int first = 100; int second = 100; first = Second ++; second = ++ first; then the values of the first and second variables are ____________ 9 in sequence. in programming, the types of flow control statements are: ______________________ 10. in switc In H (expression), the expression type can be those: ___________________ 11. find out the syntax error in the following code: int n = 10; Switch (true) {default: N ++; Case N: N * = 2; case 10: N * = 2;} 12. the number of times the following loop is written: _____________ int K = 65535; while (K! = 0) {k/= 2;} 13. read the following code: int [] Kind; kind = new int [15]; where the value of kind [0] is: _________ what about kind [15? ____________ 14. Read the following code: int [] test = {,}; then the value of test [4] is: ___________ and the value of test [6? ___________ 15. after writing the following code, the value of each element in the array is: int [] n = {1, 3, 4, 2}; n [0] = 10; N [3] + = N [2]; n [1] = N [2] + N [3]; n [2] ++; then the values of each element in the array are: _______________ 16. the following code is used to calculate the maximum value in an array. Please complete the code: int [] M = {3, 20, 12, 13}; int max = _________________; For (INT I = 0; I <m. length; I ++) {If (_____________) {max = m [I] ;}} 17. java is a simple program language, and we will study it in our mobile game develop course. :__________ ______________________ 18. Logical question: How can I divide 7 apples of the same size and distribute them evenly to four people using a general fruit knife? __________________________________ 19. mathematical Problem: To solve the binary primary equation 2x + 3 = 3y3x + 2 = 2y, the values of X and Y are: ______________ 20. mathematical questions: If the radius of an already known circle is 10, the circumference and area of the circle are __________________ (Note: The circumference value is 3.14). 2. Short answer questions (5 points for each question, total 15 points) 1. briefly describe how Java implements platform-independent (cross-platform) principles. 2. the following code describes the execution process of the for statement. For (Statement A; statement B; Statement C) {Statement D;} 3. description of the syntax format of the three annotations in Java, and purpose 3. Programming question (15 points per question, total 45 points) requirements: Compile the complete code, the code is submitted as an independent file, and a Java source file is created for each question.) 1. write code to determine whether the Number 1059 is a prime number )? Note: prime number refers to the natural number that can only be divisible by 1 and itself. The minimum prime number is. write code to reverse the array element. For example, {1, 2, 3, 4} is changed to {4, 3, 2, 1} 3. Write the code and output the 99 multiplication table.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.