Java程序基础测试题

promotion of employment, form a reasonable and orderly pattern of income distribution, build a more fair and sustainable social security systems, medical and health system reform. The plenary, innovation of social governance, must focus on the maintenance of fundamental interests of the overwhelming majority of the people, maximize factors, enhance social development, improving social governance, the interests of national security, ensure that the people live and work, social stability and order. o improve social governance, stimulating social organization, innovative and effective system of preventing and resolving social conflicts, improving the public security system, set up the National Security Council, national security systems and national security strategy to ensure national security. Plenary session, the construction of ecological civilization, you must establish systems of ecological system, using the system to protect the ecological environment. o improve naturalresources asset property right system and use control, red line of delimitation of ecological protection, resources paid use system and ecological compensation system in ecological environment protection management system reform. Plenary session, centering on building a listening party command, can win and having a fine style of the people's army, a strong army under the new situation of the party Goals, restricting the development of national defense and army building is solved outstanding contradictions and problems, innovation and development of military theory, enhance military strategic guidance, improve the military strategy in the new period, building a modern military force system with Chinese characteristics. o deepen the adjustment of personnel system reform in the army, military policy and system reform, promote the development of military and civilian integration depth. Plenary session stressed that comprehensive reform must be to strengthen and improve theparty's leadership, give full play to the core role of the party commands the overall situation and coordinating all parties, improving the party's leading water ... Margin. Challenged the leadership of the Communist Party of China, Marxism-Leninism and Mao Zedong thought by Deng Xiao-ping's flag, replaced by three representatives and the harmonic society. The former Communist Party spirit and social cohesion point of almost all political makeover. Characteristics of socialism public ownership is shifting to private ownership, planned regulation and market regulation, the proletarian regime controlled by the elite. Of universal equality, fairness and basic principles of distribution system is socialist society, however after economic monopolized by powerful, vested interests growemployers do not have the same status, hardly seems fair social distbution. State key protection of capital interests rather than the interests of citizens, had been hits the bottom of the proletariat Java程序基础测试题

一、填空(每题2分,总计40分)

1. 分别写出数字17的二进制、八进制和十六进制表示形式:________________ 写出-17的补码:_____________

2. int类型的变量在内存中占用______字节,char型的变量在内存占用_____位。 3. Java语言的基础开发工具是:_____________,集成开发工具是:____________

4. 在jdk中,Java语言的编译命令是____________,Java语言的执行命令是_______。 5. 已知字符a的编码是97,大写字符A的编码是65,而且大写字符和小写字符的编码都是连续的,则小写字符e和大写字符E的编码依次是:_____________ 6. 写出以下表达式的结果: 1) 5 % 6 / 3 2) true && false 3) 5 >> 3 4) 12 ^ -4

7. 修改以下代码中的错误: 1) float f = 1.0; 2) char c = ; 3) byte b = 200; 4) long int = 100;

8. 阅读以下代码,写出程序执行结果: int first = 100; int second = 100; first = second++; second = ++first;

则变量first和second的值依次是________________

9. 在程序设计中,流程控制语句的类型有:______________________

10. 在switch(表达式)中,表达式的类型可以是那些类型:___________________ 11. 找出以下代码中存在的语法错误: int n = 10; switch(true){ default: n++; case n: n *=2; case 10: n *=2; }

12. 写出以下循环执行的次数是:_________________ int k = 65535; while(k != 0){ k /= 2; }

13. 阅读以下代码: int[] kind;

bviously, face China's Socialist system, the Communist Party is not the party. In that case, political chaos has been very tight. Is remodeling or reconstruction, is a correction or a stove. Whether to turn right or left, is back to the source or put forward new political ideas. This is to determine the road problems in China, is also the key out of the deep water of the reform of the economic system. After 18, the new Central collective leadership attaches great importance to political orientation. First, the \cles\ng point, starting from the Central Government's self-restraint, which preaches and pro-image, brought fresh feeling to the community. Secondly, before reform and opening up and reform and opening two periods after non-negative, untying the tangle of the society a long time on this issue. Third, a new generation of party leaders on various occasions to Mao Ze-Dong and Mao Ze-Dong's thought of evaluation has room for manoeuvre, through to the ruling ideology of Mao Zedong thought, is the call of the soul to the Socialist Revolution and construction. Empty talks jeopardize national interests and try again, is an affirmation of Deng Xiao-ping's reform ideas. These strong political signal showing a new generation of political leaders is still keeping to the Socialist road. Four is revisiting the \o Ze-Dong's historical cycle of\ofile anti-corruption and the importance of the Constitution, reorganization is bad style of officialdom, was to civilize people obey the law, while improving the color change of the regime of vigilance. Five is to reform into deeper waters and stressed that top-level design, this is a review on the reform and opening up in the past, is also looking for a way out. Six foreign and Russia closer, the flexible attitude on the issue of the Korean peninsula, Sino-Japanese fishing hardline China on the island out of the \nt\ow profile shadow began to gradually plan development. Signs show that the new leadership began to make a left turn in politics. However, as of right now, not only ideological confusion in the community, the new leadership's thinking is messy. New leaders both stressed the need to implement the Constitution, stressed the need to turn off the power in a cage. Also stresses that Mao Zedong thought cannot be lost, 30 years after the reform and opening up 30 years ago can not deny each other. Both advocate democracy and release \n does not speak of\cal constraints. Neither deny the history of the CPC Central Committee on several issues ...Comrades: today brings together members, mainly in order to provide a platform to Exchange and learn from each other in order to facilitate our work. Just now, we focus on taxation, planning and stability, safety, project construction, typical topics such as private facts presentation and interaction, and towns currently exist in the in-depth analysis of the problems to be solved, to explore new methods to solve the problem. It can be said that summing up the achievement, no grandstanding; analysis promotion of employment, form a reasonable and orderly pattern of income distribution, build a more fair and sustainable social security systems, medical and health system reform. The plenary, innovation of social governance, must focus on the maintenance of fundamental interests of the overwhelming majority of the people, maximize factors, enhance social development, improving social governance, the interests of national security, ensure that the people live and work, social stability and order. o improve social governance, stimulating social organization, innovative and effective system of preventing and resolving social conflicts, improving the public security system, set up the National Security Council, national security systems and national security strategy to ensure national security. Plenary session, the construction of ecological civilization, you must establish systems of ecological system, using the system to protect the ecological environment. o improve naturalresources asset property right system and use control, red line of delimitation of ecological protection, resources paid use system and ecological compensation system in ecological environment protection management system reform. Plenary session, centering on building a listening party command, can win and havng a fine style of the people's army, a strong army under the new situation of the party Goals, restricting the development of national defense and army building is solved outstanding contradictions and problems, innovation and development of military theory, enhance military strategic guidance, improve the military strategy in the new period, building a modern military force system with Chinese characteristics. o deepen the adjustment of personnel system reform in the army, military policy and system reform, promote the development of military and civilian integration depth. Plenary session stressed that comprehensive reform must be to strengthen and improve theparty's leadership, give full play to the core role of the party commands the overall situation and coordinating all parties, improving the party's leading water ... Margin. Challenged the leadership of the Communist Party of China, Marxism-Leninism and Mao Zedong thought by Deng Xiao-ping's flag, replaced by three representatives and the harmonic society. The former Communist Party spirit and social cohesion point of almost all political makeover. Characteristics of socialism public ownership is shifting to private ownership, planned regulation and market regulation, the proletarian regime controlled by the elite. Of universal equality, fairness and basic principles of distribution system is socialist society, however after economic monopolized by powerful, vested interests growemployers do not have the same status, hardly seems fair sociadistribution. State key protection of capital interests rather than the interests of citizens, had been hits the bottom of the proletariat kind = new int[15];

其中kind[0]的值是:_________

那么kind[15]的呢?________________ 14. 阅读以下代码:

int[] test = {4,2,3,1,2,1}; 则test[4]的值是:___________ 而test[6]的值呢?___________

15. 写出以下代码运行结束以后,数组中每个元素的值: int[] n = {1,3,4,2}; n[0] = 10; n[3] += n[2];

n[1] = n[2] + n[3]; n[2]++;

则数组中各元素的值依次是:___________________ 16. 以下是求数组中最大值的代码,请补充完整: 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. 逻辑题:把7个大小一样的苹果,使用一般的水果刀平均分配给4个人,每个苹果最多切3刀,如何来分?

__________________________________ 19. 数学题:求解二元一次方程 2x + 3 = 3y 3x + 2 = 2y

则x和y的值依次是:__________________

20. 数学题:已知圆的半径是10,则该圆的周长和面积依次是:__________________ (说明:∏值取3.14)

二、简答题(每题5分,总计15分)

1. 简述Java语言实现平台无关(跨平台)性的原理。

2. 按照下面的代码简述for语句的执行流程 for(语句A;语句B;语句C){ 语句D; }

bviously, face China's Socialist system, the Communist Party is not the party. In that case, political chaos has been very tight. Is remodeling or reconstruction, is a correction or a stove. Whether to turn right or left, is back to the source or put forward new political ideas. This is to determine the road problems in China, is also the key out of the deep water of the reform of the economic system. After 18, the new Central collective leadership attaches great importance to political orientation. First, the \cles\ng point, starting from the Central Government's self-restraint, which preaches and pro-image, brought fresh feeling to the community. Secondly, before reform and opening up and reform and opening two periods after non-negative, untying the tangle of the society a long time on this issue. Third, a new generation of party leaders on various occasions to Mao Ze-Dong and Mao Ze-Dong's thought of evaluation has room for manoeuvre, through to the ruling ideology of Mao Zedong thought, is the call of the soul to the Socialist Revolution and construction. Empty talks jeopardize national interests and try again, is an affirmation of Deng Xiao-ping's reform ideas. These strong political signal showing a new generation of political leaders is still keeping to the Socialist road. Four is revisiting the \o Ze-Dong's historical cycle of\ofile anti-corruption and the importance of the Constitution, reorganization is bad style of officialdom, was to civilize people obey the law, while improving the color change of the regime of vigilance. Five is to reform into deeper waters and stressed that top-level design, this is a review on the reform and opening up in the past, is also looking for a way out. Six foreign and Russia closer, the flexible attitude on the issue of the Korean peninsula, Sino-Japanese fishing hardline China on the island out of the \nt\ow profile shadow began to gradually plan development. Signs show that the new leadership began to make a left turn in politics. However, as of right now, not only ideological confusion in the community, the new leadership's thinking is messy. New leaders both stressed the need to implement the Constitution, stressed the need to turn off the power in a cage. Also stresses that Mao Zedong thought cannot be lost, 30 years after the reform and opening up 30 years ago can not deny each other. Both advocate democracy and release \n does not speak of\cal constraints. Neither deny the history of the CPC Central Committee on several issues ...Comrades: today brings together members, mainly in order to provide a platform to Exchange and learn from each other in order to facilitate our work. Just now, we focus on taxation, planning and stability, safety, project construction, typical topics such as private facts presentation and interacton, and towns currently exist in the in-depth analysis of the problems to be solved, to explore new methods to solve the problem. It can be said that summing up the achievement, no grandstanding; analysispromotion of employment, form a reasonable and orderly pattern of income distribution, build a more fair and sustainable social security systems, medical and health system reform. The plenary, innovation of social governance, must focus on the maintenance of fundamental interests of the overwhelming majority of the people, maximize factors, enhance social development, improving social governance, the interests of national security, ensure that the people live and work, social stability and order. o improve social governance, stimulating social organization, innovative and effective system of preventing and resolving social conflicts, improving the public security system, set up the National Security Council, national security systems and national security strategy to ensure national security. Plenary session, the construction of ecological civilization, you must establish systems of ecological system, using the system to protect the ecological environment. o improve naturalresources asset property right system and use control, red line of delimitation of ecological protection, resources paid use system and ecological compensation system in ecological environment protection management system reform. Plenary session, centering on building a listening party command, can win and having a fine style of the people's army, a strong army under the new situation of the party Goals, restricting the development of national defense and army building is solved outstanding contradictions and problems, innovation and development of military theory, enhance military strategic guidance, improve the military strategy in the new period, building a modern military force system with Chinese characteristics. o deepen the adjustment of personnel system reform in the army, military policy and system reform, promote the development of military and civilian integration depth. Plenary session stressed that comprehensive reform must be to strengthen and improve theparty's leadership, give full play to the core role of the party commands the overall situation and coordinating all parties, improving the party's leading water ... Margin. Challenged the leadership of the Communist Party of China, Marxism-Leninism and Mao Zedong thought by Deng Xiao-ping's flag, replaced by three representatives and the harmonic society. The former Communist Party spirit and social cohesion point of almost all political makeover. Characteristics of socialism public ownership is shifting to private ownership, planned regulation and market regulation, the proletarian regime controlled by the elite. Of universal equality, fairness and basic principles of distribution system is socialist society, however after economic monopolized by powerful, vested interests growemployers do not have the same status, hardly seems fair social distribution. State key protection of capital interests rather than the interests of citizens, had been hits the bottom of the proletariat

3. 说明Java语言中三种注释的语法格式,以及用途

三、编程题(每题15分,总计45分)

要求:编写完整的代码,代码以独立文件的格式提交,每个题目建立一个java源文件) 1. 编写代码,判断数字1059是否是质数(素数)?

说明:质数指只能被1和自身整除的自然数,最小的质数是2.

2. 编写代码,实现数组元素的颠倒。例如{1,2,3,4}变成{4,3,2,1} 3. 编写代码,输出99乘法表。

bviously, face China's Socialist system, the Communist Party is not the party. In that case, political chaos has been very tight. Is remodeling or reconstruction, is a correction or a stove. Whether to turn right or left, is back to the source or put forward new political ideas. This is to determine the road problems in China, is also the key out of the deep water of the reform of the economic system. After 18, the new Central collective leadership attaches great importance to political orientation. First, the \point, starting from the Central Government's self-restraint, which preaches and pro-image, brought fresh feeling to the community. Secondly, before reform and opening up and reform and opening two periods after non-negative, untying the tangle of the society a long time on this issue. Third, a new generation of party leaders on various occasions to Mao Ze-Dong and Mao Ze-Dong's thought of evaluation has room for manoeuvre, through to the ruling ideology of Mao Zedong thought, is the call of the soul to the Socialist Revolution and construction. Empty talks jeopardize national interests and try again, is an affirmation of Deng Xiao-ping's reform ideas. These strong political signal showing a new generation of political leaders is still keeping to the Socialist road. Four is revisiting the \ng to Mao Ze-Dong's historical cycle of\profile anti-corruption and the importance of the Constitution, reorganization is bad style of officialdom, was to civilize people obey the law, while improving the color change of the regime of vigilance. Five is to reform into deeper waters and stressed that top-level design, this is a review on the reform and opening up in the past, is also looking for a way out. Six foreign and Russia closer, the flexible attitude on the issue of the Korean peninsula, Sino-Japanese fishing hardline China on the island out of the \ent\ow profile shadow began to gradually plan development. Signs show that the new leadership began to make a left turn in politics. However, as of right now, not only ideological confusion in the community, the new leadership's thinking is messy. New leaders both stressed the need to implement the Constitution, stressed the need to turn off the power in a cage. Also stresses that Mao Zedong thought cannot be lost, 30 years after the reform and opening up 30 years ago can not deny each other. Both advocate democracy and release \n does not speak of\iles of political constraints. Neither deny the history of the CPC Central Committee on several issues ...Comrades: today brings together members, mainly in order to provide a platform to Exchange and learn from each other in order to facilitate our work. Just now, we focus on taxation, planning and stability, safety, project construction, typical topics such as private facts presentation and interaction, and towns currently exist in the in-depth analysis of the problems to be solved, to explore new methods to solve the problem. It can be said that summing up the achievement, no grandstanding; analysis

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4