2018秋招笔试科大讯飞java笔试试题

合集下载

(全)近几年科大讯飞软件笔试题目学习资料

(全)近几年科大讯飞软件笔试题目学习资料
}
请问运行Test函数会有什么样的结果?
a)_会出错,不能传递动态分配的内存,str一直为空
char *GetMemory(void)
{
Char p[]=”hello world”);
Return p;
}
Void Test(void)
{
Char *str=NULL;
Str=GetMemory();
Printf(str);
8、(8分)以下是一组有关内存知识的问题,请仔细看题,回答:
Void GetMemory(char *p)
{
P=(char *)malloc(100);
}
Void Test(void)
{
Char *str=Null;
GetMemory(str);
Strcpy(str,”hello world”);
Printf(str);
Virtual void Fn()
{printf(“B fn called.\n”);}
};
Class C:public B
(全)近几年科大讯飞软件笔试题目
2009讯飞软件开发笔试题目(C++)A卷
1、(4分)用变量a给出下面的定义
a)一个整型数;
b)一个指向整型数的指针;
c)一个指向指针的指针,它指向的指针是指向一个整型数;
d)一个有10个整型的数组;
e)一个有10个指针的数组,该指针是指向一个整型数;:
a)#define seconds365*24*60*60
b)#define MIN(a,b) ((a)<(b)?(a):(b))
扩展:MAX宏#define MAX ((a)>(b)(a):(b))

java笔试题目

java笔试题目

笔试题目姓名:第一类:JAVA开发试题一、不定项选择题1.假设你被给予如下设计:“一个人有姓名,年龄,地址和性别。

你将要设计一个类来表示一类叫做病人的人。

这种人可以被给予诊断,有配偶并且可能活着”。

假设表示人的类已经创建了,当你设计病人类,如下哪些应该被包含在内?( )A.registration dateB.ageC.sexD.diagnosis2.假如你写了一个程序用于读取8MB的文本文件。

一行一行地讲到一个String对象中,但是你发现执行性能不好。

最可能的解释是?( )A.Java I/O是围绕最慢的设备而设计的,它本身就很慢B.String类不适合I/O操作,字符数组将更合适C.因为String的不变性,每一次读要创建一个新的String对象,改为StringBuffer可能会提高性能D.以上都不正确3.EL表达式${erName}与下列哪个语句等价?( )A.<%=StringUtils.trimToEmpty((String)request.getSession().getAttribute("userName"))%>B.<%=StringUtils.trimToEmpty((String)request.getAttribute("userName"))%>C.<%=StringUtils.trimToEmpty(request.getParameter("userName"))%>D.以上都不是4.查看以下游标定义语句,哪行会引起错误?()1. DECLARE2. CURSOR cust_cursor(p_custId,p_LastName)3. IS4. SELECT cust_id,first_name,last_name,credit_limit5. FROM customer6. WHERE cust_id =p_custId7. AND last_name=p_LastName;A. 第2行B. 第4行C. 第5行D. 第6行二、填空题1.Oracle数据库的默认端口号是( );Tomcat默认的端口号是( );Telnet协议默认的端口号是( );。

JAVA企业笔试面试题集(带答案

JAVA企业笔试面试题集(带答案

一. 选择题(234)1.下面中哪两个可以在A 的子类中使用:()class A {protected int method1 (int a, int b) {return 0;}}A. public int method 1 (int a, int b) { return 0; }B. private int method1 (int a, int b) { return 0; }C. private int method1 (int a, long b) { return 0; }D. public short method1 (int a, int b) { return 0; }解答:AC主要考查子类重写父类的方法的原则B,子类重写父类的方法,访问权限不能降低C,属于重载D,子类重写父类的方法返回值类型要相同或是父类方法返回值类型的子类2.Abstract method cannot be static. True or False ?A TrueB False解答:A抽象方法可以在子类中被重写,但是静态方法不能在子类中被重写,静态方法和静态属性与对象是无关的,只与类有关,这与 abstract 是矛盾的,所以 abstract 是不能被修饰为static,否则就失去了abstract 的意义了3.What will be the output when you compile and execute the following program.class Base{void test() {System.out.println("Base.test()");}}public class Child extends Base{ void test(){ System.out.println("Child.test()");}static public void main(String[] a){ Child anObj = new Child();Base baseObj = (Base)anObj;baseObj.test();}}Select most appropriate answer.A Child.test()Base.test()B Base.test()Child.test()C Base.test()D Child.test()解答:D测试代码相当于:Base baseObj = new Child();父类的引用指向子类的实例,子类又重写了父类的test 方法,因此调用子类的test 方法。

近两年科大讯飞实习生笔试、面试题

近两年科大讯飞实习生笔试、面试题

第一题是递归判断五子棋问题,在一个棋盘上,0代表空,1代表黑子,2代表白子,现给定一个坐标(ax,ay),代表当前下的黑子的位置,求递归判断黑子是否已经赢了(不考虑赢的趋势,也即仅仅判断当前状态)然后就是问如何求1到1000000内所有素数,(相信弄过一点算法都清楚筛选法)最后问了个如何在一个序列中求第k大的数,笔者当时脑袋一热回答了二叉搜索树+优先级(也OK),面试官听完后就来了句,不就是堆嘛。

1. 已知二叉树的前序遍历为ABCDEFGHIJ,中序遍历为CBEDAHGIJF,请画出其二叉树结构。

2.求一个整数数组的最大元素,用递归方法实现。

1.<span>#include <iostream>2.#include <cmath>ing namespace std;4.5.int maxnum(int a[], int n)6.{7.if(n == 1)8.return a[0];9.if(n>1)10. {11.return max(a[0], maxnum(a+1,n-1));12. }13.}14.int main()15.{16.int num[10] = {0,1,2,3,4,5,6,7,8,9};17. cout<<maxnum(num,10)<<endl;18.return 0;3.什么是虚拟存储器?虚拟存储器的特点是什么?虚拟存储器:在具有层次结构存储器的计算机系统中,自动实现部分装入和部分替换功能,能从逻辑上为用户提供一个比物理贮存容量大得多,可寻址的“主存储器”。

虚拟存储区的容量与物理主存大小无关,而受限于计算机的地址结构和可用磁盘容量。

特点:多次性、对换性、虚拟性。

多次性是指一个作业被分成多次调入内存运行,亦即在作业运行时没有必要将其全部装入,只需将当前要运行的那部分程序和数据装入内存即可;以后每当要运行到尚未调入的那部分程序时,再将它调入。

近两年科大讯飞实习生笔试、面精彩试题

近两年科大讯飞实习生笔试、面精彩试题
报文(Message)队列(消息队列):消息队列是消息的表,包括Posix消息队列system V消息队列。有足够权限的进程可以向队列中添加消息,被赋予读权限的进程则可以读走队列中的消息。消息队列克服了信号承载信息量少,管道只能承载无格式字节流以及缓冲区大小受限等缺点。
共享存:使得多个进程可以访问同一块存空间,是最快的可用IPC形式。是针对其他通信机制运行效率较低而设计的。往往与其它通信机制,如信号量结合使用,来达到进程间的同步及互斥。
25.print(a);
26.print(trim(a));
27.return0;
28.}
第二部分:填空题(2*6)
1.操作系统中的存储管理常用(虚拟存储器)的方式来摆脱主存容量的限制。
2.满二叉树第i层上的叶子节点数有(2的i-1次方)个。
3.二分查找算法的平均时间复杂度是(logn)。
4.设x=3,y=2,x<<y=(12)。
pPrev = pNode;
pNode = pNext;
}
return pReversedHead;
}
7、输入x y z,然后输出序列的可能性
X Y Z
X Z Y
Y X Z
Y Z X
Z Y X
8、怎么用一个类将一个实例完全复制给另外一个实例
填空题有STL库由哪部分组成,
简答题:1.冒泡排序和快速排序的优缺点
{
public static boolean isPrime(int num)
{
for(int i=2;i<=Math.Sqrt(num):i++)
{
if(num%i==0){
return false;

2018年下半年程序员考试程序员基础知识真题及标准答案

2018年下半年程序员考试程序员基础知识真题及标准答案

2018年下半年程序员考试程序员基础知识真题(总分:75.00,做题时间:150分钟)一、单项选择题(总题数:69,分数:75.00)1.以下关于信息和数据的描述中,错误的是()。

(分数:1.00)A.通常从数据中可以提取信息B.信息和数据都由数字组成√C.信息是抽象的、数据是具体的D.客观事物中都蕴涵着信息解析:2.问卷的设计原则不包括()。

(分数:1.00)A.所选问题必须紧扣主题,先易后难B.要尽量提供回答选项C.应便于校验、整理和统计D.问卷中应尽量使用专业术语,让他人无可挑剔√解析:3.在Excel的A1单元格中输入公式“=ROUND(14.9, 0)”,按回车键后,A1单元格中的值为()。

(分数:1.00)A.10B.14.9C.13.9D.15 √解析:4.在Excel的A1单元格中输入公式“=POWER(MIN(-4,-1,1,4), 3)”,按回车键后,Al单元格中显示的值为()。

(分数:1.00)A.-1B.-64 √C.1D.64解析:5.()服务的主要作用是提供远程登录服务。

(分数:1.00)A.GopherB.FTPC.Telnet √D.E-mail解析:6.在存储体系中,位于主存与CPU之间的高速缓存(Cache)用于存放主存中部分信息的副本,主存地址与Cache地址之间的转换工作()。

(分数:1.00)A.由系统软件实现B.由硬件自动完成√C.由应用软件实现D.由用户发出指令完成解析:7.计算机系统中,CPU对主存的访问方式属于()。

(分数:1.00)A.随机存取√B.顺序存取C.索引存取D.哈希存取解析:8.在指令系统的各种寻址方式中,获取操作数最快的方式是()。

(分数:1.00)A.直接寻址B.间接寻址C.立即寻址√D.寄存器寻址解析:9.在计算机外部设备和主存之间直接传送而不是由CPU执行程序指令进行数据传送的控制方式称为()。

(分数:1.00)A.程序查询方式B.中断方式C.并行控制方式D.DMA方式√解析:10.以下关于磁盘碎片整理程序的描述,正确的是()。

java考试题带答案.doc

java考试题带答案.doc

第一章复习题1.4 Source program means the original program written in a high-level language・ A compiler is a program that translates source program into executable code・1.7 Developed by a team led by James Gosling at Sun Microsystems in 1991 ・ Originally called Oak, it became Java in 1995 when it was redesig ned for developi ng In ter net applicati ons.1.11Keywords have spec讦ic meaning to the compiler and cannot be used for other purposes in the program such as variables or method names・ Examples of keywords are class, static, and void.1.12Java source code is case sensitive .Java keywords are always in lowercase ・1.13The source file extension is .java and the bytecode file extension is .class.1.16public class Welcome {public static void mein(String[] args) {System.ou t•print丄n(HmorningH);System, out "afternoon");i1.17Line 2. Main should be main.Line 2. static is missing.Line 3: Welcome to Java! should be en closed in side double quotati on marks ・Line 5: The last) should be }.1.18javac is the JDK comma nd to compile a program, java is the JDK comma nd to run a progra m. 1.19Java interpreter cannot find the ・class file・ Make sure you placed the ・class in the right place, and inv oked java comma nd with appropriate package n ame ・1.20The class does not have a main method, or the sign ature of the main method is in correct. 编程题1-6public class Exercisel_6 {public static void main(String[] args) {System.out.pri ntln(l + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9);}}1-7public class Exercisel_7 {public static void main(String[] args) {System.out.println(4 * (1 -1.0 / 3 + 1.0 / 5 ・ 1.0 / 7 +1.0/ 9・ 1.0/11 + 1.0/13));}}第二章复习题2.1Valid identifiers: applet, Applet, $4, apps, x, y, radiusIn valid ide ntifiers: a++, -a, 4#R, #44, class, public, intKeywords:class, public, int2.14Line 2: Missing static for the main method.Line 2: string should be String.Line 3: i is defined but not initialized before it is used in Line 5.Line 4: k is an int, cannot assign a double value to k・Lines 7-8: The string cannot be broken into two lines.2.24bc-22.25System.out.println("l" + 1); => 11System.out.printlnCl' + 1); => 50 (since the Unicode for 1 is 49System.out.println("l" + 1 + 1); => 111System.out.println("l" + (1 + 1)); => 12System.out.println('l' + 1 + 1); => 51编程练习2.2import java.util.Seanner;public class Exercise2_2 {public static void main(String[] args) {Scanner input = new Scanner(System.in);// Enter radius of the cylinderSystem.out.print(,f Enter radius of the cylinder:H);double radius = input.nextDoublef);// Enter length of the cylinderSystem.out.print(H Enter length of the cylinder:");double length = input.nextDouble();double volume = radius * radius * 3.14159 * length;System.out.println("The volume of the cylinder is H + volume);}}2.6// Exercise2_6.java: Summarize all digits in an integer < 1000 public class Exercise2_6 {// Main methodpublic static void main(String[] args) {java.util.Scanner in put = new java.util.Sca nn er(System.in); // Read a numberSystem.out.print(“Enter an integer between 0 and 1000:H); int nu mber = in put. nextl nt();// Find all digits in numberint lastDigit = number % 10;int remainingNumber = number / 10;int sec on dLastDigit = remain! ngNumber % 10;remai ningNumber = remai ningNumber / 10;int thirdLastDigit = remai ningNumber % 10;// Obtain the sum of all digitsint sum = lastDigit + secondLastDigit + thirdLastDigit;// Display resultsSystem.out.println(H The sum of all digits in H + number+ " is n + sum);}}第三章复习题3.12 Consider score is 90, what will be the grade?3.26 Consider score is 90, what will be the grade?编程练习3.1import java.util.Sca nner;public class Exercise3_l {public static void main(String[] args) {Sea nner in put = new Scan ner(System.i n);System.out.print(H Enter a, b, c:H);double a = input.nextDouble();double b = in put. nextDouble();double c = input.nextDouble();double discriminant = b * b ・4*a*c;if (discriminant < 0) {System.out.println「The equation has no roots'1);else if (discriminant == 0) {double rl =・b / (2 * a);System.out.println("The root is " + rl);}else {// (discriminant > 0)double rl = (-b + Math.powfdiscriminant, 0.5)) / (2 * a);double r2 = (-b - Math.pow(discriminant, 0.5)) / (2 * a);System.out.println("The roots are H + rl + " and H + r2);}}}第四章复习题4.1count < 100 always true at Point A. count < 100 always false at Point C. count < 100 is sometimes true or sometimes false at Point B・4.3(a)Infinite number of times.(b)Infinite number of times.(c)The loop body is executed nine times・ The printout is 3, 5, 7, 9 on separate lines.4.7max is 5n umber 04.20After the continue statement is executed, the statementj++will be executed・ The output of this fragment is1212234.21Line 2: missing static.Line 3: The semicolon (;) at the end of the for loop heading should be removed.Line 4: sum not defined.Line 6: the semicolon (;) at the end of the if statement should be removed・Line 6: j not defined.Line 7: Missing a semicolon for the first printin statement.Line 11: The semicolon (;) at the end of the while heading should be removed・Line 18: Missing a semicolon at the end of the do-while loop.4.22(A) compile error: i is not initialized・(B) Line 3: The ; at the end of for loop should be removed・for (int i = 0; i < 10; i++);编程练习4.1import java.util.Seanner;public class Exercise4_l {public static void main(String[] args) {int countPositive=0, countNegative = 0;int count = 0, total = 0, num;Sea nner in put = new Sea nn er(System.i n);System.out.print(”En ter an int value, the program exits if the in put is 0:"); num 二input.nextlnt();while (num != 0) {if (num > 0)coun tPositive++;else if (num < 0)coun tNegative++;total += num;coun t++;// Read the next numbernum = input.nextl nt();}if (count == 0)System.out.println(”You didn't enter any number");else {System.out.println(H The number of positives is H + countPositive); System.out.println(n The number of negatives is H + countNegative); System.out.println("The total is " + total);System.out.println(H The average is H + total * 1.0 / count);}}}4.10public class Exercise4_10 {public static void main(String[] args) {int count = 1;for (int i = 100; i <= 1000; i++)讦(i%5== 0&&i % 6 == 0)System.out.print((count++ % 10 != 0) ? i + "i + "\n");}}4.15public class Exercise4_15 {public static void main(String[] args) {java.util.Scanner in put = new java.util.Sca nn er(SystemJn);//Enter nlSystem.out.print(”Enter the first number:");int nl = in put. nextl nt();// Enter n2System.out.print("Enter the second number:");int n2 = in put. nextlnt();int d = (nl < n2) ? nl: n2;for (; d >= 1; d--) {讦((nl % d == 0) && (n2 % d == 0)) { break;}}System.out.println("GCD of ” + nl + " and ” + n2 + " is "+ d);}}4.20public class Exercise4_20 {// Main methodpublic static void main(String[] args) {int count = 1; // Count the number of prime numbers int number = 2; // A number to be tested for primeness boolean isPrime = true; // If the current number is prime?System.out.println("The prime numbers from 2 to 1000 are \n H);// Repeatedly test if a new number is primewhile (number <= 1000) {// Assume the number is primeisPrime = true;// Set isPrime to false,讦the number is primefor (int divisor = 2; divisor <= number / 2; divisor++) {if (number % divisor == 0) {// If true, the number is prime isPrime = false;break; // Exit the for loop}}// Print the prime nu mber and in crease the count if (isPrime) {讦(count%8 == 0) {// Print the number and advance to the new line System.out.printl n(number);}else System.out.pri nt(n umber + 11H);count++; // Increase the count}// Check if the next number is primenu mber++;}}}4.26public class Exercise4_26 {public static void main(String[] args) {double e = 1;double item = 1;for (int i = 1; i <= 100000; i++) {item = item / i;e += item;讦(i == 10000 11 i== 20000 11 i == 30000 11 i == 40000 | | i == 50000 11 i== 60000 11 i == 70000 11 i == 80000 11 i == 90000 | | i== 100000)System.out.println("The e is " + e + " for i = " + i);}}}笫五章复习题5.8Line 2: methodi is not defined correctly. It does not have a return type or void・Line 2: type int should be declared for parameter m.Line 7: parameter type for n should be double to match method2(3.4).Line 11: if (nvO) should be removed in method, otherwise a compile error is reported・5.15Line 7: int n = 1 is wrong since n is already declared in the method signature.编程练习5.2// Exercise5_2.java: Create a method for summarizing digits in an intpublic class Exercise5_2 {public static void main(String[] args) {java .u til.Scanner in put = new java.util.Sea rm er(System.in);System.out.print(H Entera number:M);int value = in put. nextl nt();System.out.pri nt In (H The sum of digits for" + value +"is " + sumDigits(value));}public static int sumDigitsflong n) {int temp = (in t)Math.abs(n);int sum = 0;while (temp != 0) {int remainder = temp % 10;sum += remainder;temp = temp / 10;}return sum;}}第八早复习题6.1See the section H Declaring and Creating Arrays/6.2You access an array using its index・6.3No memory is allocated when an array is declared・ The memory is allocated when creating the array・x is 60The size of numbers is 306.6 The array index type is int and its lowest index is 0.a[2]6.8A run time excepti on occurs ・6.9Line 3: the array declaration is wrong. It should be doublet]・ The array needs to be created before its been used. e.g. new double[10]Line 5: The semicolon (;) at the end of the for loop heading should be removed・Line 5: r.length() should be r.length・Line 6: random should be random()Line 6: r(i) should be r[i],编程练习题6.1二维数组实现杨辉三角冒泡法排序import java.util.Scanner;public class Exercise6_l {/** Main method */public static void main(String[] args) {// Create a SeannerSea nner in put = new Sea nn er(System.i n);// Get number of studentsSystem.out.print(H Enter number of students:H);int nu mberOfStude nts = in put. nextl nt();int[] scores = new int[numberOfStudents]; // Array scoresint best = 0; // The best scorechar grade; // The grade// Read scores and find the best scoreSystem.out.print(H Enter ” + numberOfStudents + H scores:n);for (int i = 0; i < scores」ength; i++) {scores[i] = in put.nextlnt();if (scores[i] > best)best = scores[i];}// Declare and initialize output stringString output =// Assign and display gradesfor (int i = 0; i < scores」ength; i++) {if (scores[i] >= best -10)grade = A;else if (scores[i] >= best - 20)grade = 8;else if (scores[i] >= best - 30) grade = f C';else if (scores[i] >= best ・ 40)grade = D;elsegrade = T1;output += "Student" + i + " score is " + scores[i] + H and grade is 11 + grade + H\n n;}// Display the resultSystem.out.printl n(output);}}第八章复习题8・2・ Constructors are special kinds of methods that are called when creating an object using the new operator. Constructors do not have a return type—not even void.8.3. An array is an object. The default value for the elements of an array is 0 for numeric, false for boolean,、u0000〃for char, null for object element type.8・4・ (a) There is such constructor ShowErrors(int) in the ShowErrors class・The ShowErrors class in the book has a default constructor. It is actually same aspublic class ShowErrors {public static void main(String[] args) {ShowErrors t = new ShowErrors(5);}public ShowErrors () {}}On Line 3, new ShowErrors(5) attempts to create an instance using a constructor ShowErrors(int), but the ShowErrors class does not have such a constructor. That is an error.(b)x() is not a method in the ShowErrors class・The ShowErrors class in the book has a default constructor. It is actually same aspublic class ShowErrors {public static void main(String[] args) {ShowErrors t = new ShowErrors();}public ShowErrors () {}}On Line 4, t.x() is invoked, but the ShowErrors class does not have the method named x()・ That is an error.(c)The program compiles fine, but it has a run time error because variable c is null when the printin statement is executed.(d)new C(5.0) does not match any constructors in class C・ The program has a compilation error because class C does not have a constructor with a double argument.8・5・ The program does not compile because new A() is used in class Test, but class A does not have a default constructor. See the second NOTE in the Section, "Constructors."8.6. false8.20(Line 4 prints null since dates[0] is nulL Line 5 causes a NullPointerException since it invokes toStri ng() method from the null ref ere nee.)第九章复习题9.1si == s2 => trues2 == s3 => falsesl.equals(s2) => trues2.equals(s3) => truepareTo(s2) => 0pareTo(s3) => 0si == s4 => truesl.charAt(O) => Wsl.indexOf('j') =>-lsl.indexOf(H to") => 8stlndexOf('a') => 14stlndexOf("o", 15) => 9sl.len gth() => 16sl.substring(5) => me to Java!sl.substring(5,11) => me tosl.startsWith("Wel") =>truesl.en dsWith("Java n) =>truesl.toLowerCase() => welcome to java!sl.toUpperCase()=> WELCOME TO JAVA!” Welcome ".trim() => Welcomesl.replaceCo', T) => WelcTme tT Java!sl.replaceAII("o"z "T") => WelcTme tT Java!sl.replaceFirstC'o", "T") => WelcTme tT Java!sl.toCharArray() returns an array of characters consisting of W, e, I, c, o, m, e, , t, o, , J, a, v, a(Note that none of the operation causes the contents of a string to change) 9.2String s = new Stri ng(”new string11);Answer: CorrectString s3 = si + s2;Answer: CorrectString s3 = si ・ s2;Answer: Incorrect si == s2Answer: Correctsi >= s2Answer: IncorrectpareTo(s2);Answer: Correctint i = sl」ength();Answer: Correctchar c = sl(0);An swer: In correctchar c = sl.charAt(sl.le ngth());An swer: Incorrect: it's out of boun ds, eve n if the precedi ng problem is fixed.9.3The output isWelcome to JavaWelcabcme tabc JavaHint: No method in the String class can change the content of the string. String is an immutable class.9.8The text is declared in Line 2 as a data field, but redeclared in Line 5 as a local variable・ The local variable is assigned with the string passed to the constructor, but the data field is still null. In Line 10? test.text is null, which causes NullPointerException when invoking the toLowerCase() method ・9.9The con structor is declared in correctly. It should not have void ・第十一章复习题11.3The following lines are erroneous:{radius = radius; // Must use this.radius = radius}class B extends Circle (missing extends){Circle(radius); // Must use super(radius)length = length; // Must use this」ength = length}public double getArea(){return getArea()*length; // super.getArea()}11.4Use super() or super(args). This statement must be the first in the constructor in the subclass.11.5Use super.method() or super.method(args).11.11B's constructor is invokedA"s constructor is invokedThe default constructor of Object is invoked, when new A(3) is invoked・ The Object's constructor is invoked before any statements in B's constructor are executed・11.14Object apple = (Apple)fruit;Causes a run time ClassCasti ngExcepti on.第十二章能使用基本的布局设计简单的界面,添加文本框和按钮,处理基本类型的事件。

2018年上半年程序员考试上午真题(完整版)

2018年上半年程序员考试上午真题(完整版)

2018年上半年程序员考试上午真题(专业解析+参考答案)1、某编辑在编辑文稿时发现如下错误,其中最严重的错误是()。

A、段落标题编号错误B、将某地区名列入了国家名单C、语句不通顺、有明显的错别字D、标点符号、字体、字号不符合要求2、某县有6.6万个贫困户,县委组织人员调査这6.6万个贫困户经济收入,从中抽取1800个贫困户的经济收入进行分析。

请问本次调查的总体、个体、样本及样本容量分别为()。

A、6.6万个贫困户经济收入、每个贫困户的经济收入、1800、1800个贫困户B、6.6万个贫困户、1800个贫困户经济收入、每个贫困户的经济收入、1800C、6.6万个贫困户、每个贫困户的经济收入、1800个贫困户经济收入、1800D、6.6万个贫困户、每个贫困户的经济收入、1800、1800个贫困户经济收入3、在Excel中,若在A1单元格输入如下图所示的内容,则A1的值为()。

A、7B、 8C、 TRUED、 #NAME?4、在Excel中,单元格L3内容为“软件工程技术”,若要取单元格L3前两个字“软件”放入单元格M3中,则在M3中可输入(),并按下回车键即可。

A、=LEFTB(M3,2)B、 =LEFT(M3,2)C、 =LEFTB(L3,2)D、 =LEFT(L3,2)5、电子邮件地址“zhangli@”中的zhangli、@和分别表示用户信箱的()。

A、邮件接收服务器域名、帐号和分隔符B、邮件接收服务器域名、分隔符和帐号C、帐号、分隔符和邮件接收服务器域名D、帐号、邮件接收服务器域名和分隔符6、程序计数器(PC)是用来指出下一条待执行指令地址的,它属于()中的部件。

A、CPUB、 RAMC、 CacheD、 USB7、以下关于主流固态硬盘的叙述中,正确的是()。

A、存储介质是磁表面存储器,比机械硬盘功耗高B、存储介质是磁表面存储器,比机械硬盘功耗低C、存储介质是闪存芯片,比机械硬盘功耗高D、存储介质是闪存芯片,比机械硬盘功耗低8、CPU中可用来暂存运算结果的是()。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

2018秋招笔试科大讯飞java笔试试题1、下列关于继承的描述错误的是()A. 在Java中允许定义一个父类的引用,指向子类对象B. 在Java中继承是通过extends关键字来描述的,而且只允许继承自一个直接父类C. 在Java中抽象类之间也允许出现继承关系D. 在Java中一个子类可以继承多个抽象类,在extends关键字后一次列出,用逗号隔开参考答案:D语法层面上抽象类和接口的区别1)抽象类可以提供成员方法的实现细节,而接口中只能存在public abstract方法;2)抽象类中的成员变量可以是各种类型的,而接口中的成员变量只能是public static final 类型的;3)接口中不能含有静态代码块以及静态方法,而抽象类可以有静态代码块和静态方法;4)一个类只能继承一个抽象类,而一个类却可以实现多个接口。

2、以下关于接口的说法错误的是()A. 接口中的成员变量和成员方法只能是Public(或者缺省不写)B. Java中的接口(interface)也继承了Object类C. 实现接口的类必须全部实现接口中的方法D. 接口中的方法只能有方法原型,不能有方法主体参考答案:B3、在一个请求分页系统中,采用NUR页面置换算法时,假如一个作业的页面走向为1,2,1,5,4,2,4,3,2,4。

当分配给该作业的物理块数为3时,访问过程中命中的次数为()A. 3B. 4C. 5D. 6参考答案:B主要的页面置换算法有:OPT、LRU、LFU、NUR以及FIFO。

FIFO:先进先出算法。

OPT:最佳置换算法。

LRU:最近最久未使用算法。

LFU:最近最少使用算法。

NUR:最近未使用算法。

4、下列程序的执行结果是()Public class Test{Public static void main(String[] args){Stytem.out.prinln(“ “ + ‘b’ +1);}}A. 99B. 981C. 198D. b1参考答案:D5、TCP套接字函数中()不会产生阻塞。

A. acceptB. bindC. writeD. Read参考答案:B6、下面关于二叉排序树的说法错误的是()A. 在二叉排序树中,完全二叉树的查找效率最低B. 对二叉排序树进行中序遍历,必定得到节点关键字的有序序列C. 二叉排序树的平均查找长度是O(log2n)D. 二叉排序树的查找效率与二叉树的树形有关参考答案:A解析:在二叉排序树中,完全二叉树的查找效率最高7、多线程与多进程的主要区别之一就是共享资源,多线程是通过互斥访问来协调共享资源,在Windows系统中使用什么对象使多线程之间对资源互斥访问()A. SysTheradB. InitTheradC. MutexD. Select参考答案:C8、在FTP服务器上FTP主进程打开的端口为()A. 23B. 20C. 21D. 22参考答案:C9、咖啡店销售系统具体需求为:咖啡店店员在卖咖啡时,可以根据顾客的要求加入各种配料,并根据加入配料价格的不同来计算总价。

若要设计该系统可以应该采用()进行设计A. 装饰模式B. 单例模式C. 原型模式D. 组合模式参考答案:A10、下列程序的执行结果是()int num = 17;while(num>0){System.out.print(num ++ %5 + “\t”);num /=5;}A. 2 4B. 3 4C. 2D. 2 3参考答案:D11、解决哈希冲突的链地址算法中,关于插入新的数据项的时间表述正确的是()A. 和数组已占用单元的百分比成正比B. 和链表数目成正比C. 和哈希表中项数成正比D. 随装填因子线性增长参考答案:D散列表的装填因子定义为:α=填入表中的元素个数/散列表的长度α是散列表装满程度的标志因子。

由于表长是定值,α与“填入表中的元素个数”成正比,所以,α越大,填入表中的元素较多,产生冲突的可能性就越大;α越小,填入表中的元素较少,产生冲突的可能性就越小。

12、下列关于Object类的说法,正确的是()A. 如果一个类显示地继承了其他类,则该类不再继承Object类B. Error类不是从Object类派生出来的C. 如果一个类是从Object类派生出来的,那么必须重写toString()和equals()方法D. 一个类如果定义为abstract的,依然继承自Object类参考答案:D13、()是调用者发出消息后,必须等待消息处理结束返回后,才能进行后续操作A. 同步消息B. 返回消息C. 异步消息D. 简单消息参考答案:A14、假设下列字符码中有奇偶校验位,但没有数据错误,采用偶校验的字符码是()A. 11010110B. 11000001C. 11001011D. 11001001参考答案:D由于干扰,可能使位变为1,(为什么不变0?)这种情况,我们称为出现了“误码”。

我们把如何发现传输中的错误,叫“检错”。

发现错误后,如何消除错误,叫“纠错”。

最简单的检错方法是“奇偶校验”,即在传送字符的各位之外,再传送1位奇/偶校验位。

可采用奇校验或偶校验。

奇校验:所有传送的数位(含字符的各数位和校验位)中,“1”的个数为奇数,如:1 0110,01010 0110,0101偶校验:所有传送的数位(含字符的各数位和校验位)中,“1”的个数为偶数,如:1 0100,01010 0100,0101奇偶校验能够检测出信息传输过程中的部分误码(奇数位误码能检出,偶数位误码不能检出),同时,它不能纠错。

在发现错误后,只能要求重发。

但由于其实现简单,仍得到了广泛使用。

有些检错方法,具有自动纠错能力。

如循环冗余码(CRC)检错等。

15、下列各序列中不是堆的是()A. (9,8,5,3,4,2,1)B. (9,4,5,8,3,1,2)C. (9,5,8,4,3,2,1)D. (9,8,5,4,3,1,2)参考答案:B解析:堆要求父节点的元素值必须全部大于或者小于子节点的元素值,A、C和D都是符合条件的大根堆,B的第三层的元素8大于第二层的父元素值4,不符合堆的条件,故而本题答案为B选项。

16、在Java中,以下哪个可以与函数public int A()(…)构成重载()A. public void A()(…)B. public int A(int m)(…)C. public void A(int n)(…)D. public static int A()(…)参考答案:B17、现有如下代码段:x = 2;while(x<n/2)x = 2*x;假设n>=0,则其时间复杂度应为()A. O(log2n)B. O(nlog2n)C. O(n)D. O(n^2)参考答案:A18、下列程序输出的结果为()int i =11,j = 5;switch(i /j){case 3;j += i;case 2;j += 4;case 4;j += 5;case 1;j += 1;break;}System.out.println(j);A. 9B. 14C. 5D. 15参考答案:Dj=5+4+5+1=1519、有关构造方法,下列叙述正确的是()A. 默认的构造方法可以具有参数B. 假如一个类缺少没有参数的构造方法,但是有其它的构造方法,,则编译器生成一个缺省的构造方法C. 编译器总会给每一个类生成一个无参的缺省构造方法D. 默认的构造方法初始化了在类中声明的实例变量参考答案:D解析:A、默认构造方法可以没有参数,也可以有参数,但是每个参数都必须有默认值。

B、有了就不会再生成缺省的了。

C、如果没有默认的构造方法,编译器才会为类生成一个无参的缺省构造方法,不是总是生成的,是有条件的。

D、默认的构造方法不初始化变量。

20、在UML中,()体现了一种contains-a的关系A. 聚合关系B. 实现关系C. 组合关系D. 关联关系参考答案:CUML定义的关系主要有六种:依赖、类属、关联、实现、聚合和组合。

组合也是关联关系的一种特例,他体现的是一种contains-a的关系,这种关系比聚合更强,也称为强聚合;他同样体现整体与部分间的关系,但此时整体与部分是不可分的,整体的生命周期结束也就意味着部分的生命周期结束;比如你和你的大脑;表现在代码层面,和关联关系是一致的,只能从语义级别来区分。

21、一个上下文无关文法一般是由一组非终结符号、一组终结符号,一个开始符号和一组产生式构成,那么产生式是用于定义()的一种规则A. 逻辑推理B. 语义成分C. 词法成分D. 语法成分参考答案:D1、可唯一确定一棵二叉树的是()A. 给定一棵二叉树的后序和中序遍历序列B. 给定一棵二叉树的先序和后序遍历序列C. 给定一棵二叉树的先序和中序遍历序列D. 给定先序、中序和后序遍历序列中的任意一个即可参考答案:A、C2、下面哪些是使用分治法的前提条件()A. 该问题具有最优子结构性质B. 原问题和子问题求解方法相同C. 子问题必须是一样的D. 子问题之间不包含公共的子问题参考答案:ABD3、下面关于Java的说法正确的是()A. 一个类只能定义一个构造函数B. 类中的构造函数不可省略C. 构造函数必须与类同名D. 普通类方法可以与类同名参考答案:C、D4、有关单例模式的说法中正确的是()A. 用户无法通过new方式实例化单例类B. 单例模式属于创建型模式C. 单例模式用于多线程应用程序D. 违背了单一职责原则参考答案:A、B、C5、下面的存储过程实现用户验证功能,如果不成功,返回0,成功则返回1.CREATE PROCEDURE VALIDATE @USERNAME CHAR,@PASSWORD CHAR,@LEGAL BIT OUTPUT AS IF EXISTS(SELECT*FROM REN WHERE SNAME = @USERNAME AND PWD = @PASSWORD) SELECT @LEGAL = 1ELSESELECT @LEGAL = 0该用户的用户名和密码分别是’Tom’和’123’,执行该存储过程语句和结果正确的是:()A. declare @LEGAL bitexec dbo.validate’Tom’,’123’,@LEGAL OUTPUTSELECT @LEGAL结果:1B. declare @LEGAL bitexec dbo.validate’TomCat’,’123’,@LEGAL OUTPUTSELECT @LEGAL结果:1C. declare @LEGAL bitexec dbo.validate’Tom’,’123’,@LEGAL OUTPUTSELECT @LEGAL结果:0D. declare @LEGAL bitexec dbo.validate’TomCat’,’123’,@LEGAL OUTPUTSELECT @LEGAL结果:0参考答案:A、D6、Spring有哪三个核心组件()A. BeansB. ContextC. IOCD. Core参考答案:A、B、D7、下列关于视图的说法中正确的是()A. 对视图的使用与表一样,也可以进行插、查、删、改操作B. 视图与表一样,也存储着数据C. 对视图的操作,是最终都要转化成对基本表的操作D. 可以根据数据库表和自由表建立视图参考答案:C、D8、关于wait()和sleep()说法正确的是()A. wait()和sleep()都会释放锁B. sleep()可以在任何地方使用C. wait()只能在方法或者语句块中使用D. wait()和sleep()都是Thread类的方法参考答案:B、Csleep()方法(休眠)是线程类(Thread)的静态方法,调用此方法会让当前线程暂停执行指定的时间,将执行机会(CPU)让给其他线程,但是对象的锁依然保持,因此休眠时间结束后会自动恢复(线程回到就绪状态,请参考第66题中的线程状态转换图)。

相关文档
最新文档