
- 养殖珍珠一般在哪个季节收获。()
- 珍珠的硬度大于琥珀,它的硬度范围是()。
- 哪个珍珠表面有火焰状结构。()
- 天然珍珠和养殖珍珠的区别()
- 珍珠有天然珍珠和养殖珍珠之分,养殖珍珠又有海水珠和淡水珠之分。
- “女摄政王”是世界第五大珍珠,最初镶嵌在法国的王冠上,曾是拿破仑一世送给第二任妻子玛丽•路易的。
- 以下哪个是Java ArrayList 类的方法?
- 执行以下语句后 myVar 的值是多少?int myVar = 5;if (myVar > 4)myVar += 5;if (myVar < 1)myVar -= 5;
- 一个包含Java代码的文件应该有哪个文件扩展名?
- 下列关于 ArrayList 类的说法正确的是?
- 以下哪些代码段是创建 String 对象的有效 Java 代码?
- 关于文件IO,下列哪些说法是正确的?
- 执行下面的代码会打印什么?if ( "string1" != "string2")System.out.println("Strings are not equal");elseSystem.out.println("Strings are equal");
- 执行以下代码的结果是什么?String letters = "KOI is awesome!";char char2 = letters.charAt(5);System.out.println(char2);
- Java 的原始名称是________________。
- 以下哪一命令将编译一个名为Student的程序?
- 下列选项中属于输入输出异常的是___________。
- 要在屏幕上打印“One world,one dream.”,请使用以下 Java 语句_______。
- _________ 语句用于在 Java 中做出简单的决定。
- 以下语句执行后fee的值是多少? ( )int hours = 45;double fee , feeRate = 10.00;fee = hours <= 40 ? hours * feeRate : 40 * feeRate + (hours - 40) * feeRate * 1.5;
- 下面的代码显示什么?double x = 152.3798146;System.out.printf("%.2f\n", x);
- 以下哪个表达式将确定 x 是否小于或等于 y?
- UML 图不包含_________。
- 数组元素的下标编号总是从什么值开始?
- 下面数组中data [2][3]的值是多少?int [] [] data = { {90, 70, 87, 92}, {85, 87, 104, 107}, {98, 95, 104, 300}, {300, 95, 107, 70} };
- 如果numbers是一个二维数组,以下哪一项会给出该数组row行的长度?
- 以下哪些类是来自Java API的类?
- 以下哪个是Java中的关键字?
- If method A calls method B, and method B calls method C, and method C calls method D, when method D finishes, what happens? 如果方法A调用方法B,方法B调用方法C,方法C调用方法D,当方法D完成时,会发生什么?
- This part of a method is a collection of statements that are performed when the method is executed.方法的这一部分是执行方法时执行的语句的集合。
- In the header, the method name is always followed by this: 在头中,方法名后面始终跟有:
- 执行赋值语句i = Integer.parseInt("120")+130; 后,i的值为__________。
- 设有数组定义:int myScores[ ] = { 20, 60,70 , 80 , 70 , 90 , 60 , 70 , 80};则myScores.length的值为____________。
- 若有定义String s ="Programing";则s.charAt(5)的值是_________。
- Java中专门提供用于表示目录与文件的类是___________。
- 设int x = 18 ; double y=10 ; 则表达式x / y的值是 ________。
- 在Java语言中,被称为内存分配的运算符是_________。
- 执行赋值语句i = Integer.parseInt("400")+300;后,i的值为__________。
- 设有两个字符串对象String s1="javaprogram"; String s2="javaproGram";,则表达式s1.equals(s2)的结果是______。
- 设有数组定义int[][] array = {{1, 4, 3,0,5, 6, 0}, {3, 4, 5}, {6, 0, 8, 9}, {0, 1, 2, 3, 0, 5, 6}};,则array.length的值为____。
- 设x = 1 , y = 2 , z = 3,则表达式y+=z--/++x 的值是__________。
- 设有数组定义:int MyIntArray[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70}; 则MyIntArray.length的值为____________。
- 执行赋值语句b = Float.parseFloat("77.63")+10; 后,输出b的值为 ___。
- 设有字符串String s = "犯我中华者虽远必诛";,则表达式s.indexOf('虽')的值是_______。
- 设有字符串定义:String s="JavaPrograming"; 则表达式s.indexOf('g')的值是_______。
- 设有字符串定义:String s="大道之行,天下为公"; 则表达式s.indexOf(',')的值是_________。
- 设有两个字符串对象str1和str2,则表达式“strl==str2”的意义是判别字符串strl和str2______。
- BufferedReader类的___________方法,可提供一次读取一行的功能。
- 应用程序Test.java的源程序如下,在命令行键入:java Test Please pay attention and keep quite请分析程序的输出的结果,并写出答案:______________________________。public class Test {public static void main(String args[]) {int count1 = args.length;int count2 = args[3].length();System.out.print(count1 + " , " + count2);}}
- 应用程序Test.java的源程序如下,在命令行键入:java Test less talk and more action请分析程序的输出的结果,并写出答案:______________________________。publicclassTest {publicstaticvoidmain(String args[]) {intcount1 = args.length;intcount2 = args[4].length();System.out.print(count1 + " , " + count2);}}
- 执行赋值语句int b = Integer.parseInt( "37" ) + 33; 后,b的值为________。
- 执行赋值语句i = Integer.parseInt("17")+13; 后,i的值为_____。
- 阅读下面的代码,回答下列问题。PrintWriter fileData = new PrintWriter(“data”);1) 执行上述代码后现在可以写入的文件的名称是什么?2) 如果上面命名的文件已经存在,会发生什么?3) 如果上面命名的文件不存在会怎样?
- 考查下面的代码,回答下列问题。int array[][] = {{9, 8, 7}, {6, 5, 4}, {3, 2, 1};int x = array[1][1];int y = array[2][2];1) 变量 x 中存储的值是多少?2) 变量 y 中存储的值是多少?
- 某系统注册功时要求:密码长度至少为6个字符;密码应至少包含1个数字。测试规定的标准后,显示一条消息,表明输入的密码是否有效。以下代码实现了该密码验证,请分析程序并将程序补充完整。import java.util.Scanner;public class PasswordValidation {public static void main(String[] args) {Scanner input = new Scanner(System.in);String password = input.nextLine();input.close();if(______(1)_____ ___) { //密码长度至少为6个字符boolean hasDigit = false; //假设没有for(int index = 0; index <password.length(); index++) {char ch = ________(2)___ ___;//取password中index位置的字符if(Character.isDigit(ch)) {hasDigit = true; //密码包含数字。break;}}if(hasDigit)System.out.println("密码符合标准");elseSystem.err.println("密码应至少包含1个数字。");}else {System.err.println("密码长度至少为6个字符。");}}}
- 创建一个文件 hobbies.txt 来存储用户的爱好。现在要求用户输入三个爱好并将它们存储在 hobbies.txt 中。 写入后关闭文件。请分析程序并将程序补充完整。import java.io.*;import java.util.Scanner;public class FileWrite {public static void main(String[] args) throws IOException {String hobbyName; // 爱好名字Scanner input = new Scanner(System.in);File file = new File("D:// hobbies.txt");_____(1)______ ___ outputFile = new PrintWriter(file);for (int i = 1; i <= 3; i++) {System.out.print("请输入爱好" + "number " + i + ": ");hobbyName = _____(2)______ ___; //从控制台读入一行字符串作为爱好outputFile.println(hobbyName); //将爱好写入文件}input.close();outputFile.close(); //关闭outputFile对象}}
- 冒泡排序算法是比较两个相邻的元素,将值大的元素交换到右边。N个元素的数组排序共进行N-1趟,即可使得元素序列按关键字有序。以下方法实现了冒泡排序,请分析程序并将程序补充完整。public static void bubbleSort(int array[]) {for (int i = 1; i < array.length; i++) {//排序共进行数组长度-1趟for (int j = 0; j < ____(1)_______ ___; j++) {if (______(2)_____ ___) {//将值大的元素交换到右边int temp = array[j];array[j] = array[j + 1];array[j + 1] = temp;}}}}
- 153是一个非常特殊的数,它等于它的每位数字的立方和,即153=1*1*1+5*5*5+3*3*3。以下编码实现了求所有满足这种条件的三位十进制数。public class Demo2 {public static void main(String[] args) {for(int a=100; a<1000; a++) {int a1 = a%10; //a的个位数int a2 = _____(1)______ ___;//a的十个位数int a3 = a/100; //a的百位数//如果a等于它的每位数字的立方和,输出aif(________(2)___ ___)System.out.println(a);}}}
- 选择排序的算法是首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素,然后放到未排序序列的开始。以此类推,直到所有元素均排序完毕。以下方法实现了选择排序,请分析程序并将程序补充完整。public static void selectionSort(int[] array) {if (array.length == 0)return;for (int i = 0; i < array.length-1; i++) {int minIndex = i; //保存剩余元素最小数的索引,i为未排序元素开始位置//将较小元素与后面每个元素比较,直到数组最后一个元素,确定最小值for (int j = i+1; j <_________(1)____________; j++) {if (array[j] < array[minIndex]) // 如果找到更小的数________(2)_____________; // 将更小数的素引暂时保存在minIndex}int temp = array[minIndex];array[minIndex] = array[i];array[i] = temp;}}
- 以下代码实现了对输入字符串的回文串的判定。请分析程序并将程序补充完整。import java.util.Scanner;public class Palindrome {public static void main(String[] args) {String s = new Scanner(System.in).next();//输入字符串char[] chars = new char[s.length()];//创建与字符串长度相同的数组for(int index=0,i=chars.length-1; index<___(1)___________; index++,i--){//取出字符串s中index位置的字符,逆序存入字符数组charschars[i] =________(2)_______________;}if(s.equals(new String(chars)))System.out.println(s+"是回文串!");elseSystem.out.println(s+"不是回文串!");}}
- 以下程序功能为计算数组各元素的和,试补充完整。public class Test {public static void main(String[] args) {int[] a = {1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10};int sum = 0;for(int i=0; i<_____(1)__________ ; i++)sum = sum+______(2)________ ;}}
- 以下代码实现了打开文件myWords.txt并在控制台上显示文件中的内容,退出程序前关闭文件。请分析程序并将程序补充完整。import java.util.Scanner;import java.io.*;public class FileRead {public static void main(String[] args) throws IOException {File file = new File("D://myWords.txt");Scanner inputFile = new Scanner(new FileReader(file));// 从文件中读取所有内容while (inputFile.hasNext()) {String words =______(1)____________; //从文件中读取一行数据System.out.println(words);}_______(2)___________; //关闭inputFile对象}}
- 方法int oddEvenNum(int[]a)的功能是求已知数组中奇数的个数。static int oddEvenNum(int []nums){ int count =0; for ( int i=0;i<__(1)____;i++ ) { if(_(2)_____) count++; } return s; }
- 将主方法的参数逐个打印输出,文件名为MyTest.java(1){ //类的声明public static void main(String args [ ] ){int n = args.length( ); //n为数组长度if(n == 0)System.out.println(“没有参数”);else{System.out.println(“参数个数:”+n);for(int i=0; i<___(2)____; i++ ) //循环System.out.println(“args[”+i+”]=”+ args[i] ); //打印数组元素}}}
- Java应用程序的main方法中有以下语句,则输出的结果是: 。int[] x={12,13,-18,17,19};int max=x[0];for(int i=1;i<x.length;i++){if(x[i]>max) max=x[i];}System.out.println(max);
- 大衍数列,来源于《乾坤谱》中对易传“大衍之数五十”的推论。主要用于解释中国传统文化中的太极衍生原理。数列中的每一项,都代表太极衍生过程中,它的前几项是:0、2、4、8、12、18、24、32、40、50 ...其规律是:对偶数项,是序号平方再除2;奇数项,是序号平方减1再除2。分析并完成以下代码打印出大衍数列的前 100 项。for(int i=1; i<100; i++){if(_______(1)_________)System.out.println(_______(2)_______); //打印太极衍生数列的偶数项值elseSystem.out.println((i*i-1)/2); //打印太极衍生数列的奇数项值}
- 以下哪个是Java中的标识符?
- 完成下面的句子。 一个try语句 ________________。
- 计算机内存中的命名存储位置叫什么?
- 以下哪个是Java中的关键字?
- JVM代表什么?
- 默认异常处理程序的动作是什么?
- 下面的数组有多少个元素?int myArray = new int[3][3];
- 可以从一个_______创建一个或多个对象。
- 在 UML 图中,________符号表示成员是公共的。
- 下列常见的系统定义的异常中,哪个是找不到文件异常 ?
- Java中的每个数组都有一个名为____________的公共字段,其中包含数组中元素的数量。
- 在UML图中,此符号表示成员是私有的:
- 下列常见的系统定义的异常中,加载类时有可能产生的类找不到异常是_____。
- In the programming process which of the following is not involved in defining what the program is to do在编程过程中,以下哪些与定义程序的工作无关:
2今日累计人数
1在线人数