SCJP考试题310-025(第二套3)51-91147
市政二级建造师继续教育考试试题及答案
2021年市政二级建造师继续教育考试第二套试题及答案判断题1、合同是产生债务关系的一种最为普遍和重要的依据。
(对)2、特种作业操作证有效期为5年,在全国范围内有效。
(对)3、投标人应当在招标文件要求提交投标文件的截止时间前,将投标文件送达投标地点。
(对)4、合同自备案时生效。
(错)解析:自生成是生效。
5、职业健康安全和环境管理体系标准均强调预防为主、系统管理、持续改进和PDCA循环原理。
(对)6、项目信息门户(PIP)是指在项目实施过程中各方产生的信息和知识进行集中式存储和管理的基础上,为各方在internet平台上提供的项目信息多个入口。
(错)解析:单个入口。
7、中标人确定后,招标人只需将中标结果通知中标的投标人即可。
(错)解析:中标人确定后,招标人应当向中标人发出中标通知书,并同时将中标结果通知所有未中标的投标人。
8、在EPC模式中,Procurement只是指设备和材料的采购。
(错)9、人工开挖沟槽的槽深超过3m时应该分层开挖。
(对)解析:1 人工开挖沟槽的槽深超过3m时应分层开挖,每层的深度不超过2m;2 人工开挖多层沟槽的层间留台宽度:放坡开槽时不应小于0.8m,直槽时不应小于0.5m,安装井点设备时不应小于1.5m;3 采用机械挖槽时,沟槽分层的深度按机械性能确定。
10、海东市城市综合管廊建设项目,管道建模使用软件自带的MEP。
11、上海市杨浦区东北部的市政排水泵站案例中,利用BIM建模的优势,结构专业可将Revit 的模型导入Robot软件,进行力学计算和受力分析。
(对)12、直接向外环境排放污染物的才征收环境保护税。
(对)13、混凝土基层检测主控项目是含水率、粗糙度、平整度。
(对)14、裂缝处治材料宜选用双组分改性环氧树脂材料。
(对)15、城市道路中,生活垃圾可以用于路基填筑。
(错)16、测量碳化深度时应注意将空洞中的粉末和碎屑除净,可以用水擦洗。
(错)解析:碳化深度值的测量,可采用适当的工具在测区表面形成直径约15mm的孔洞,其深度应大于混凝土的碳化深度。
SCJP认证试题及答案
转载对题目和答案谨做参考Q1A method is ...1) an implementation of an abstraction.2) an attribute defining the property of a particular abstraction.3) a category of objects.4) an operation defining the behavior for a particular abstraction.5) a blueprint for making operations.Q2An object is ...1) what classes are instantiated from.2) an instance of a class.3) a blueprint for creating concrete realization of abstractions.4) a reference to an attribute.5) a variable.Q3Which line contains a constructor in this class definition?public class Counter { // (1)int current, step;public Counter(int startValue, int stepValue) { // (2)set(startValue);setStepValue(stepValue);}public int get() { return current; } // (3)public void set(int value) { current = value; } // (4)public void setStepValue(int stepValue) { step = stepValue; } // (5) }1) Code marked with (1) is a constructor2) Code marked with (2) is a constructor3) Code marked with (3) is a constructor4) Code marked with (4) is a constructor5) Code marked with (5) is a ConstructorQ4Given that Thing is a class, how many objects and reference variables are created by the following code?Thing item, stuff;item = new Thing();Thing entity = new Thing();1) One object is created2) Two objects are created3) Three objects are created4) One reference variable is created5) Two reference variables are created6) Three reference variables are created.Q5An instance member…1) is also called a static member2) is always a variable3) is never a method4) belongs to a single instance, not to the class as a whole5) always represents an operationQ6How do objects pass messages in Java?1) They pass messages by modifying each other's member variables2) They pass messages by modifying the static member variables of each other's classes3) They pass messages by calling each other's instance member methods4) They pass messages by calling static member methods of each other's classes.Q7Given the following code, which statements are true?class A {int value1;}class B extends A {int value2;}1) Class A extends class B.2) Class B is the superclass of class A.3) Class A inherits from class B.4) Class B is a subclass of class A.5) Objects of class A have a member variable named value2.Q8If this source code is contained in a file called SmallProg.java, what command should be used to compile it using the JDK?public class SmallProg {public static void main(String args[]) { System.out.println("Good luck!"); }}1) java SmallProg2) avac SmallProg3) java SmallProg.java4) javac SmallProg.java5) java SmallProg mainQ9Given the following class, which statements can be inserted at position 1 without causing the code to fail compilation?public class Q6db8 {int a;int b = 0;static int c;public void m() {int d;int e = 0;// Position 1}}1) a++;2) b++;3) c++;4) d++;5) e++;Q10Which statements are true concerning the effect of the >> and >>> operators?1) For non-negative values of the left operand, the >> and >>> operators will have the same effect.2) The result of (-1 >> 1) is 0.3) The result of (-1 >>> 1) is -1.4) The value returned by >>> will never be negative as long as the value of the right operand is equal to or greater than 1.5) When using the >> operator, the leftmost bit of the bit representation of the resulting value will always be the same bit value as the leftmost bit of the bit representation of the left operand.Q11What is wrong with the following code?class MyException extends Exception {}public class Qb4ab {public void foo() {try {bar();} finally {baz();} catch (MyException e) {}}public void bar() throws MyException {throw new MyException();}public void baz() throws RuntimeException {throw new RuntimeException();}}1) Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in its throws clause.2) A try block cannot be followed by both a catch and a finally block.3) An empty catch block is not allowed.4) A catch block cannot follow a finally block.5) A finally block must always follow one or more catch blocks.Q12What will be written to the standard output when the following program is run?public class Qd803 {public static void main(String args[]) {String word = "restructure";System.out.println(word.substring(2, 3));}}1) est2) es3) str4) st5) sQ13Given that a static method doIt() in a class Work represents work to be done, what block of code will succeed in starting a new thread that will do the work?CODE BLOCK A:Runnable r = new Runnable() { public void run() {Work.doIt();}};Thread t = new Thread(r);t.start();CODE BLOCK B:Thread t = new Thread() {public void start() {Work.doIt();}};t.start();CODE BLOCK C:Runnable r = new Runnable() { public void run() {Work.doIt();}};r.start();CODE BLOCK D:Thread t = new Thread(new Work()); t.start();CODE BLOCK E:Runnable t = new Runnable() { public void run() {Work.doIt();}};t.run();1) Code block A.2) Code block B.3) Code block C.4) Code block D.5) Code block E.Q14Write a line of code that declares a variable named layout of type LayoutManager and initializes it with a new object, which when used with a container can lay out components in a rectangular grid of equal-sized rectangles, 3 components wide and 2 components high.Q15public class Q275d {static int a;int b;public Q275d() {int c;c = a;a++;b += c;}public static void main(String args[]) {new Q275d();}}1) The code will fail to compile, since the constructor is trying to access static members.2) The code will fail to compile, since the constructor is trying to use static member variable a before it has been initialized.3) The code will fail to compile, since the constructor is trying to use member variable b before it has been initialized.4) The code will fail to compile, since the constructor is trying to use local variable c before it has been initialized.5) The code will compile and run without any problems.Q16What will be written to the standard output when the following program is run?public class Q63e3 {public static void main(String args[]) {System.out.println(9 ^ 2);}}1) 812) 73) 114) 05) falseQ17Which statements are true concerning the default layout manager for containers in the java.awt package?1) Objects instantiated from Panel do not have a default layout manager.2) Objects instantiated from Panel have FlowLayout as default layout manager.3) Objects instantiated from Applet have BorderLayout as default layout manager.4) Objects instantiated from Dialog have BorderLayout as default layout manager.5) Objects instantiated from Window have the same default layout manager as instances of Applet.Q18Which declarations will allow a class to be started as a standalone program?1) public void main(String args[])2) public void static main(String args[])3) public static main(String[] argv)4) final public static void main(String [] array)5) public static void main(String args[])Q19Under which circumstances will a thread stop?1) The method waitforId() in class MediaTracker is called.2) The run() method that the thread is executing ends.3) The call to the start() method of the Thread object returns.4) The suspend() method is called on the Thread object.5) The wait() method is called on the Thread object.Q20When creating a class that associates a set of keys with a set of values, which of these interfaces is most applicable?1) Collection2) Set3) SortedSet4) MapQ21What does the value returned by the method getID() found in class java.awt.AWTEvent uniquely identify?1) The particular event instance.2) The source of the event.3) The set of events that were triggered by the same action.4) The type of event.5) The type of component from which the event originated.Q22What will be written to the standard output when the following program is run?class Base {int i;Base() {add(1);}void add(int v) {i += v;}void print() {System.out.println(i);}}class Extension extends Base {Extension() {add(2);}void add(int v) {i += v*2;}}public class Qd073 {public static void main(String args[]) {bogo(new Extension());}static void bogo(Base b) {b.add(8);b.print();}}1) 92) 183) 204) 215) 22Q23Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?public class Qf575 {// insert declaration of a native method here}1) native public void setTemperature(int kelvin);2) private native void setTemperature(int kelvin);3) protected int native getTemperature();4) public abstract native void setTemperature(int kelvin);5) native int setTemperature(int kelvin) {}Q24How does the weighty property of the GridBagConstraints objects used in grid bag layout affect the layout of the components?1) It affects which grid cell the components end up in.2) It affects how the extra vertical space is distributed.3) It affects the alignment of each component.4) It affects whether the components completely fill their allotted display area vertically.Q25Which statements can be inserted at the indicated position in the following code to make the program write 1 on the standard output when run?public class Q4a39 {int a = 1;int b = 1;int c = 1;class Inner {int a = 2;int get() {int c = 3;// insert statement herereturn c;}}Q4a39() {Inner i = new Inner();System.out.println(i.get());}public static void main(String args[]) {new Q4a39();}}1) c = b;2) c = this.a;3) c = this.b;4) c = Q4a39.this.a;5) c = c;Q26Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done?public class Q76a9 {static String f() {String a = "hello";String b = "bye"; // (0)String c = b + "!"; // (1)String d = b;b = a; // (2)d = a; // (3)return c; // (4)}public static void main(String args[]) {String msg = f();System.out.println(msg); // (5)}}1) The line marked (1).2) The line marked (2).3) The line marked (3).4) The line marked (4).5) The line marked (5).Q27Which methods from the String and StringBuffer classes modify the object on which they are called?1) The charAt() method of the String class.2) The toUpperCase() method of the String class.3) The replace() method of the String class.4) The reverse() method of the StringBuffer class.5) The length() method of the StringBuffer class.Q28Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?class A {}class B extends A {}class C extends A {}public class Q3ae4 {public static void main(String args[]) {A x = new A();B y = new B();C z = new C();// insert statement here}}1) x = y;2) z = x;3) y = (B) x;4) z = (C) y;5) y = (A) y;Q29Which of these are keywords in Java?1) default2) NULL3) String4) throws5) longQ30It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?1) Mark the method with the keyword public.2) Mark the method with the keyword protected.3) Mark the method with the keyword private.4) Mark the method with the keyword package.5) Do not mark the method with any accessibility modifiers.Q31Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?CODE FRAGMENT A:int[][] tab = {{ 0, 0, 0 },{ 0, 0, 0 }};CODE FRAGMENT B:int tab[][] = new int[4][];for (int i=0; iCODE FRAGMENT C:int tab[][] = {0, 0, 0, 0,0, 0, 0, 0,0, 0, 0, 0,0, 0, 0, 0};CODE FRAGMENT D:int tab[3][2];CODE FRAGMENT E:int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };1) Code fragment A.2) Code fragment B.3) Code fragment C.4) Code fragment D.5) Code fragment E.Q32What will be the result of attempting to run the following program?public class Qaa75 {public static void main(String args[]) {String[][][] arr = {{ {}, null },{ { "1", "2" }, { "1", null, "3" } },{},{ { "1", null } }};System.out.println(arr.length + arr[1][2].length);}}1) The program will terminate with an ArrayIndexOutOfBoundsException.2) The program will terminate with a NullPointerException.3) 4 will be written to standard output.4) 6 will be written to standard output.5) 7 will be written to standard output.Q33Which expressions will evaluate to true if preceded by the following code? String a = "hello";String b = new String(a);String c = a;char[] d = { 'h', 'e', 'l', 'l', 'o' };1) (a == "Hello")2) (a == b)3) (a == c)4) a.equals(b)5) a.equals(d)Q34Which statements concerning the following code are true?class A {public A() {}public A(int i) { this(); }}class B extends A {public boolean B(String msg) { return false; }}class C extends B {private C() { super(); }public C(String msg) { this(); }public C(int i) {}}1) The code will fail to compile.2) The constructor in A that takes an int as an argument will never be called as a result of constructing an object of class B or C.3) Class C has three constructors.4) Objects of class B cannot be constructed.5) At most one of the constructors of each class is called as a result of constructing an object of class C.Q35Given two collection objects referenced by col1 and col2, which of these statements are true?1) The operation col1.retainAll(col2) will not modify the col1 object.2) The operation col1.removeAll(col2) will not modify the col2 object.3) The operation col1.addAll(col2) will return a new collection object,containing elements from both col1 and col2.4) The operation col1.containsAll(Col2) will not modify the col1 object.Q36Which statements concerning the relationships between the following classes are true?class Foo {int num;Baz comp = new Baz();}class Bar {boolean flag;}class Baz extends Foo {Bar thing = new Bar();double limit;}1) A Bar is a Baz.2) A Foo has a Bar.3) A Baz is a Foo.4) A Foo is a Baz.5) A Baz has a Bar.Q37Which statements concerning the value of a member variable are true, when no explicit assignments have been made?1) The value of an int is undetermined.2) The value of all numeric types is zero.3) The compiler may issue an error if the variable is used before it is initialized.4) The value of a String variable is "" (empty string).5) The value of all object variables is null.Q38Which statements describe guaranteed behavior of the garbage collection and finalization mechanisms?1) Objects are deleted when they can no longer be accessed through any reference.2) The finalize() method will eventually be called on every object.3) The finalize() method will never be called more than once on an object.4) An object will not be garbage collected as long as it is possible for an active part of the program to access it through a reference.5) The garbage collector will use a mark and sweep algorithm.Q39Which code fragments will succeed in printing the last argument given on the command line to the standard output, and exit gracefully with no output if no arguments are given?CODE FRAGMENT A:public static void main(String args[]) {if (args.length != 0)System.out.println(args[args.length-1]);}CODE FRAGMENT B:public static void main(String args[]) {try { System.out.println(args[args.length]); }catch (ArrayIndexOutOfBoundsException e) {}}CODE FRAGMENT C:public static void main(String args[]) {int ix = args.length;String last = args[ix];if (ix != 0) System.out.println(last);}CODE FRAGMENT D:public static void main(String args[]) {int ix = args.length-1;if (ix > 0) System.out.println(args[ix]);}CODE FRAGMENT E:public static void main(String args[]) {try { System.out.println(args[args.length-1]); }catch (NullPointerException e) {}}1) Code fragment A.2) Code fragment B.3) Code fragment C.4) Code fragment D.5) Code fragment E.Q40Which of these statements concerning the collection interfaces are true?1) Set extends Collection.2) All methods defined in Set are also defined in Collection.3) List extends Collection.4) All methods defined in List are also defined in Collection.5) Map extends Collection.Q41What is the name of the method that threads can use to pause their execution until signalled to continue by another thread?Fill in the name of the method (do not include a parameter list).Q42Given the following class definitions, which expression identifies whether the object referred to by obj was created by instantiating class B rather than classes A, C and D?class A {}class B extends A {}class C extends B {}class D extends A {}1) obj instanceof B2) obj instanceof A && ! (obj instanceof C)3) obj instanceof B && ! (obj instanceof C)4) obj instanceof C || obj instanceof D5) (obj instanceof A) && ! (obj instanceof C) && ! (obj instanceof D)Q43What will be written to the standard output when the following program is run?public class Q8499 {public static void main(String args[]) {double d = -2.9;int i = (int) d;i *= (int) Math.ceil(d);i *= (int) Math.abs(d);System.out.println(i);}}1) 122) 183) 84) 125) 27Q44What will be written to the standard output when the following program is run?public class Qcb90 {int a;int b;public void f() {a = 0;b = 0;int[] c = { 0 };g(b, c);System.out.println(a + " " + b + " " + c[0] + " ");}public void g(int b, int[] c) {a = 1;b = 1;c[0] = 1;}public static void main(String args[]) {Qcb90 obj = new Qcb90();obj.f();}}1) 0 0 02) 0 0 13) 0 1 04) 1 0 05) 1 0 1Q45Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?1) The rectangle drawn will have a total width of 5 pixels.2) The rectangle drawn will have a total height of 6 pixels.3) The rectangle drawn will have a total width of 10 pixels.4) The rectangle drawn will have a total height of 11 pixels.Q46Given the following code, which code fragments, when inserted at the indicated location, will succeed in making the program display a button spanning the whole window area?import java.awt.*;public class Q1e65 {public static void main(String args[]) {Window win = new Frame();Button but = new Button("button");// insert code fragment herewin.setSize(200, 200);win.setVisible(true);}}1) win.setLayout(new BorderLayout()); win.add(but);2) win.setLayout(new GridLayout(1, 1)); win.add(but);3) win.setLayout(new BorderLayout()); win.add(but, BorderLayout.CENTER);4) win.add(but);5) win.setLayout(new FlowLayout()); win.add(but);Q47Which method implementations will write the given string to a file named "file", using UTF8 encoding?IMPLEMENTATION A:public void write(String msg) throws IOException {FileWriter fw = new FileWriter(new File("file"));fw.write(msg);fw.close();}IMPLEMENTATION B:public void write(String msg) throws IOException {OutputStreamWriter osw =new OutputStreamWriter(new FileOutputStream("file"), "UTF8");osw.write(msg);osw.close();}IMPLEMENTATION C:public void write(String msg) throws IOException { FileWriter fw = new FileWriter(new File("file"));fw.setEncoding("UTF8");fw.write(msg);fw.close();}IMPLEMENTATION D:public void write(String msg) throws IOException { FilterWriter fw = FilterWriter(new FileWriter("file"), "UTF8"); fw.write(msg);fw.close();}IMPLEMENTATION E:public void write(String msg) throws IOException { OutputStreamWriter osw = new OutputStreamWriter(new OutputStream(new File("file")), "UTF8");osw.write(msg);osw.close();}1) Implementation A.2) Implementation B.3) Implementation C.4) Implementation D.5) Implementation E.Q48Which are valid identifiers?1) _class2) $value$3) zer@4) ¥ngstr5) 2muchuqQ49What will be the result of attempting to compile and run the following program?public class Q28fd {public static void main(String args[]) {int counter = 0;l1:for (int i=10; i<0; i--) {l2:int j = 0;while (j < 10) {if (j > i) break l2;if (i == j) {counter++;continue l1;}}counter--;}System.out.println(counter);}}1) The program will fail to compile.2) The program will not terminate normally.3) The program will write 10 to the standard output.4) The program will write 0 to the standard output.5) The program will write 9 to the standard output.Q50Given the following interface definition, which definitions are valid?interface I {void setValue(int val);int getValue();}DEFINITION A:(a) class A extends I {int value;void setValue(int val) { value = val; }int getValue() { return value; }}DEFINITION B:(b) interface B extends I {void increment();}DEFINITION C:(c) abstract class C implements I {int getValue() { return 0; }abstract void increment();}DEFINITION D:(d) interface D implements I {void increment();}DEFINITION E:(e) class E implements I {int value;public void setValue(int val) { value = val; } }1) Definition A.2) Definition B.3) Definition C.4) Definition D.5) Definition E.Q51Which statements concerning the methods notify() and notifyAll() are true?1) Instances of class Thread have a method called notify().2) A call to the method notify() will wake the thread that currently owns the monitor of the object.3) The method notify() is synchronized.4) The method notifyAll() is defined in class Thread.5) When there is more than one thread waiting to obtain the monitor of an object, there is no way to be sure which thread will be notified by the notify() method.Q52Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?1) Member variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.2) Member variables of the outer instance can never be referred to using only the variable name within the inner instance.3) More than one inner instance can be associated with the same outer instance.4) All variables from the outer instance that should be accessible in the inner instance must be declared final.5) A class that is declared final cannot have any inner classes.Q53What will be the result of attempting to compile and run the following code?public class Q6b0c {public static void main(String args[]) {int i = 4;float f = 4.3;double d = 1.8;int c = 0;if (i == f) c++;if (((int) (f + d)) == ((int) f + (int) d)) c += 2;System.out.println(c);}}1) The code will fail to compile.2) 0 will be written to the standard output.3) 1 will be written to the standard output.4) 2 will be written to the standard output.5) 3 will be written to the standard output.Q54Which operators will always evaluate all the operands?1) ||2) +3) &&4) ? :5) %Q55Which statements concerning the switch construct are true?1) All switch statements must have a default label.2) There must be exactly one label for each code segment in a switch statement.3) The keyword continue can never occur within the body of a switch statement.4) No case label may follow a default label within a single switch statement.5) A character literal can be used as a value for a case label.Q56Which modifiers and return types would be valid in the declaration of a working main() method for a Java standalone application?1) private2) final3) static4) int5) abstractQ57What will be the appearance of an applet with the following init() method?public void init() {add(new Button("hello"));}1) Nothing appears in the applet.2) A button will cover the whole area of the applet.3) A button will appear in the top left corner of the applet.4) A button will appear, centered in the top region of the applet.5) A button will appear in the center of the applet.Q58Which statements concerning the event model of the AWT are true?1) At most one listener of each type can be registered with a component.2) Mouse motion listeners can be registered on a List instance.3) There exists a class named ContainerEvent in package java.awt.event.4) There exists a class named MouseMotionEvent in package java.awt.event.5) There exists a class named ActionAdapter in package java.awt.event.Q59Which statements are true, given the code new FileOutputStream("data", true) for creating an object of class FileOutputStream?1) FileOutputStream has no constructors matching the given arguments.2) An IOExeception will be thrown if a file named "data" already exists.3) An IOExeception will be thrown if a file named "data" does not already exist.4) If a file named "data" exists, its contents will be reset and overwritten.5) If a file named "data" exists, output will be appended to its current contents.Q60Given the following code, write a line of code that, when inserted at the indicated location, will make theoverriding method in Extension invoke the overridden method in class Base on the current object.class Base {public void print() {System.out.println("base");}}class Extention extends Base {public void print() {System.out.println("extension");// insert line of implementation here}}public class Q294d {public static void main(String args[]) {Extention ext = new Extention();ext.print();}}Fill in a single line of implementation.Q61Given that file is a reference to a File object that represents a directory, which code fragments will succeed in obtaining a list of the entries in the directory?1) Vector filelist = ((Directory) file).getList();2) String[] filelist = file.directory();3) Enumeration filelist = file.contents();4) String[] filelist = file.list();5) Vector filelist = (new Directory(file)).files();Q62What will be written to the standard output when the following program is run?。
SCJP考试简介
SCJP考试简介●考试方式全英文试题,以电脑作答,在授权的Prometric考试中心参加考试考试编号:310-025先决条件:无考试题型:复选、填空和拖拽匹配题量:59及格标准:61%时限:120分钟费用:1250元●要求具备的能力●使用Java编程语言创建Java应用程序和applets。
●定义和描述垃圾搜集,安全性和Java虚拟机(JVM)。
●描述和使用Java语言面向对象的特点。
●开发图形用户界面(GUI)。
利用Java支持的多种布局治理。
●描述和使用Java的事件处理模式。
●使用Java语言的鼠标输入、文本、窗口和菜单窗口部件。
●使用Java的例外处理来控制程序执行和定义用户自己的例外事件。
●使用Java语言先进的面向对象特点, 包括方法重载、方法覆盖、抽象类、接口、final、static和访问控制。
●实现文件的输入/输出(I/O)。
●使用Java语言内在的线程模式来控制多线程。
●使用Java 的Sockets机制进行网络通信。
例题1:Choose the three valid identifiers from those listed below.A. IDoLikeTheLongNameClassB. $byteC. constD. _okE. 3_case解答:A, B, D点评:Java中的标示符必须是字母、美元符($)或下划线(_)开头。
要害字与保留字不能作为标示符。
选项C中的const是Java的保留字,所以不能作标示符。
选项E中的3_case 以数字开头,违反了Java的规则。
例题2:How can you force garbage collection of an object?A. Garbage collection cannot be forcedB. Call System.gc().C. Call System.gc(), passing in a reference to the object to be garbage collected.D. Call Runtime.gc().E. Set all references to the object to new values(null, for example).解答:A点评:在Java中垃圾收集是不能被强迫立即执行的。
2023年12月青少年机器人技术等级考试理论综合试卷二级真题及答案
2023年12月青少年机器人技术等级考试理论综合试卷二级真题(含答案)分数:100 题数:45一、单选题(共30题,共60分)。
1.下图中,能够将圆周运动转化为往复摆动的是?()A. aB. bC. cD. d试题编号:20231124135734309试题类型:单选题标准答案:D2.如图,该机械结构可实现的运动方式为?()A. 往复摆动B. 单向持续转动C. 单向间歇性运动D. 双向持续转动试题编号:20231124135735913试题类型:单选题标准答案:C试题编号:20231124135707188试题类型:单选题标准答案:C4.下列选项使用了摆动型从动件的是?()A. aB. bC. cD. d试题编号:20231124135732718试题类型:单选题标准答案:D试题编号:20231124135700374试题类型:单选题标准答案:C6.如图,关于该机构说法正确的是?()A. 这是反向双曲柄机构B. a和b的旋转方向相同C. 这是棘轮机构D. 这是滑杆机构试题编号:20231124135718301试题类型:单选题标准答案:A7.如图,关于该机构说法正确的是?()A. 属于外啮合棘轮试题编号:20231124135736119 试题类型:单选题标准答案:D试题编号:20231124135716167 试题类型:单选题标准答案:C试题编号:20231124135718883 试题类型:单选题标准答案:D试题编号:20231124135728165 试题类型:单选题标准答案:D11.如图,该机构为?()A. 曲柄滑块机构B. 滑杆机构C. 曲柄摇杆D. 双摇杆机构试题编号:20231124135719048 试题类型:单选题标准答案:A试题编号:20231124135736460 试题类型:单选题标准答案:A13.该机构属于哪种棘轮机构?()A. 摩擦式棘轮机构B. 外啮合棘轮机构C. 内啮合棘轮机构D. 双动式棘轮机构试题编号:20231124135734434试题类型:单选题标准答案:C试题编号:20231124135731146试题类型:单选题标准答案:C15.如图,向两张纸中间吹风,说法正确的是?()A. 两张纸向外分离B. 两张纸向中间并拢C. 两张纸静止不动D. 两张纸都左右摆动试题编号:20231124135700546试题类型:单选题标准答案:B试题编号:20231124135733919试题类型:单选题标准答案:C试题编号:20231124135738664 试题类型:单选题标准答案:A试题编号:20231124135717035 试题类型:单选题标准答案:D试题编号:20231124135715556 试题类型:单选题标准答案:D试题编号:202311241357315746 试题类型:单选题标准答案:A试题编号:20231124135727106 试题类型:单选题标准答案:D试题编号:20231124135718751 试题类型:单选题标准答案:B试题编号:20231124135707592 试题类型:单选题标准答案:C试题编号:20231124135736303 试题类型:单选题标准答案:D25.下图中哪个是皮带交叉传动?()A. aB. bC. cD. d试题编号:20231124135733155试题类型:单选题标准答案:C试题编号:20231124135701537 试题类型:单选题标准答案:A试题编号:20231124135747750 试题类型:单选题标准答案:B试题编号:20231124135716378 试题类型:单选题标准答案:A试题编号:20231124135716056 试题类型:单选题标准答案:C试题编号:20231124135700954试题类型:单选题标准答案:D二、多选题(共5题,共20分)试题编号:20231124135718551试题类型:多选题标准答案:A|B|C|D试题编号:20231124135707662 试题类型:多选题标准答案:A|B|C试题编号:20231124135728480 试题类型:多选题标准答案:A|B|C34.下列图片是间歇运动机构的有哪些?()A. aB. bC. cD. d试题编号:20231124135715947试题类型:多选题标准答案:A|B|D35.如图,关于飞机机翼的截面图,说法正确的有哪些?()A. 机翼上侧气流速度快B. 机翼下侧气流速度快C. 机翼上侧气压低D. 机翼下侧气压低试题编号:20231124135700593试题类型:多选题标准答案:A|C三、判断题(共10题,共20分)试题编号:20231124135715994试题类型:判断题标准答案:正确试题编号:20231124135717441试题类型:判断题标准答案:错误试题编号:20231124135718723 试题类型:判断题标准答案:错误试题编号:20231124135706678 试题类型:判断题标准答案:错误试题编号:20231124135738789 试题类型:判断题标准答案:正确试题编号:20231124135735107 试题类型:判断题标准答案:正确试题编号:20231124135736322 试题类型:判断题标准答案:错误试题编号:20231124135716135 试题类型:判断题标准答案:正确试题编号:20231124135719490 试题类型:判断题标准答案:错误试题编号:20231124135706946 试题类型:判断题标准答案:正确。
SCJP认证考试题库2
SCJP认证考试题库2What is the result?A. n ullB. zeroC. s omeD. C ompilation failsE. An exception is thrown at runtimeAnswer: ( D )13行会报错,应在15行使用else if 参考大纲:流程控制QUESTION 63Given the exhibit:What is the result?A. testB. ExceptionC. Compilation failsD. NullPointerExceptionAnswer: ( C )18行出错,应该先catch子异常,再catch Exception;13行把args赋null ,14行会报NullPointerException如果没有第13行运行时14行会报ArrayIndexOutOfBoundsException异常。
参考大纲:异常处理QUESTION 64Given the exhibit:What is the result?A. Compilation failsB. aAaA aAa AAaa AaAC. AAaa AaA aAa aAaAD. AaA AAaa aAaA aAaE. aAa AaA aAaA AAaaF. An exception is thrown at runtimeAnswer: ( C )第10行将对strings这个集合做自然排序(ASCII小到大,一个一个比较)Collections.sort(List list) 对list进行排序,对set 不能排序!List里可以放对象,所以当list里面存放的是对象的时候就不能用Collections.sort(List list)去排序了。
因为JVM不知道用什么规则去排序!!只有把对象类实现Comparable接口,然后改写compareTo()参考大纲:集合QUESTION 65Given the exhibit:What is the result?A. 0B. 1C. 2D. 3E. 4F. Compilation fails.G. An exception is thrown at runtimeAnswer: ( D )Set中存放的元素是无序不重复的。
一些SCJP考试题含答案
一些SCJP考试题含答案Leading the way in IT testing and certification tools,QUESTION NO: 92 Given:1. String foo = “blue”;2. Boolean[]bar = new Boolean [1];3. if (bar[0]) {4. foo = “green”;5. }What is the result?A. Foo has the value of “”B. Foo has the value of null.C. Foo has the value of “blue”D. Foo has the value of “green”E. An exception is thrown.F. The code will not compile.Answer: FQUESTION NO: 93Exhibit:1. public class X {2. public static void main (String[]args) {3. String s1 = new String (“true”);4. Boolean b1 = new Boolean (true);5. if (s2.equals(b1)) {6. System.out.printIn(“Equal”);7. }8. }9. }What is the result?A. The program runs and prints nothing.B. The program runs and prints “Equal”C. An error at line 5 causes compilation to fail.D. The program runs but aborts with an exception.Answer: AQUESTION NO: 94Given:1. public class Foo {2. public static void main (String []args) {3. int i = 1;4. int j = i++;5. if ((i>++j) && (i++ ==j)) {6. i +=j;7. }9. }What is the final value of i?A. 1B. 2C. 3D. 4E. 5Answer: BQUESTION NO: 95Exhibit:1. public class X {2. public static void main (String[]args) {3. string s = new string (“Hello”);4. modify(s);5. System.out.printIn(s);6. }7.8. public static void modify (String s) {9. s += “world!”;10. }11. }What is the result?E. The program runs and prints “Hello”F. An error causes compilation to fail.G. The program runs and prints “Hello world!”H. The program runs but aborts with an exception. Answer: AQUESTION NO: 96Which two are equivalent? (Choose Two)A. 16>4B. 16/2C. 16*4D. 16>>2E. 16/2^2F. 16>>>2Answer: D, EQUESTION NO: 97Exhibit:1. public class X {2. public static void main (String[]args) {3. int [] a = new int [1]4. modify(a);5. System.out.printIn(a[0]);7.8. public static void modify (int[] a) {9. a[0] ++;10. }11. }What is the result?A. The program runs and prints “0”B. The program runs and prints “1”C. The program runs but aborts with an exception.D. An error “possible undefined variable” at line 4 causes compilation to fail.E. An error “possible undefined variable” at line 9 causes compilation to fail. Answer: BQUESTION NO: 98Given:13. public class Foo {14. public static void main (String [] args) {15. StringBuffer a = new StringBuffer (“A”);16. StringBuffer b = new StringBuffer (“B”);17. operate (a,b);18. system.out.printIn,a + “,” +b-;19. )20. static void operate (StringBuffer x, StringBuffer y) {21. y.append {x};22. y = x;23. )24. }What is the result?A. The code compiles and prints “A,B”.B. The code compiles and prints “A, BA”.C. The code compiles and prints “AB, B”.D. The code compiles and prints “AB, AB”.E. The code compiles and prints “BA, BA”.F. The code does not compile because “+” cannot be overloaded for stringBuffer. Answer: BQUESTION NO: 99Given:1. public class X {2. public static void main (String[] args) {3. byte b = 127;4. byte c = 126;5. byte d = b + c;6. }7. }Which statement is true?A. Compilation succeeds and d takes the value 253.B. Line 5 contains an error that prevents compilation.C. Line 5 throws an exception indicating “Out of range”D. Line 3 and 4 contain error that prevent compilation.E. The compilation succeeds and d takes the value of 1.Answer: BQUESTION NO: 100Given:1. public class WhileFoo {2. public static void main (String []args) {3. int x= 1, y = 6;4. while (y--) {x--;}5. system.out.printIn(“x=” + x “y =” + y);6. }7. }What is the result?A. The output is x = 6 y = 0B. The output is x = 7 y = 0C. The output is x = 6 y = -1D. The output is x = 7 y = -1E. Compilation will fail.Answer: EQUESTION NO: 101Which statement is true?A. The Error class is a untimeException.B. No exceptions are subclasses of Error.C. Any statement that may throw an Error must be enclosed in a try block.D. Any statement that may throw an Exception must be enclosed in a try block.E. Any statement that may thro a runtimeException must be enclosed in a try block. Answer: DQUESTION NO: 102Exhibit:1. int I=1, j=02.3. switch(i) {4. case 2:5. j+=6;6.7. case 4:8. j+=1;9.10. default:11. j +=2;12.13. case 0:14. j +=4;15. }16.What is the value of j at line 16?A. 0B. 1C. 2D. 4E. 6Answer: AEQUESTION NO: 103Given:1. switch (i) {2. default:3. System.out.printIn(“Hello”);4. )What is the acceptable type for the variable i?A. ByteB. LongC. FloatD. DoubleE. ObjectF. A and BG. C and DAnswer: AQUESTION NO: 104You need to store elements in a collection that guarantees that no duplicates are stored. Which twointerfaces provide that capability? (Choose Two)A. Java.util.MapB. Java.util.SetC. Java.util.ListD. Java.util.StoredSetE. Java.util.StoredMapF. Java.util.CollectionAnswer: B, DQUESTION NO: 105Which statement is true for the class java.util.ArrayList?A. The elements in the collection are ordered.B. The collection is guaranteed to be immutable.C. The elements in the collection are guaranteed to be unique.D. The elements in the collection are accessed using a unique key.E. The elements in the collections are guaranteed to be synchronized.Answer: AQUESTION NO: 106Exhibit:1. public class X implements Runnable(2. private int x;3. private int y;4.5. public static void main(String[]args)6. X that = new X();7. (new Thread(that)).start();8. (new Thread(that)).start();9. )10.11. public void run() (12. for (;;) (13. x++;14. y++;15. System.out.printIn(“x=” + x + “, y = ” + y);16. )17. )18. )What is the result?A. Errors at lines 7 and 8 cause compilation to fail.B. The program prints pairs of values for x and y that might not always be the same on the same line(for example, “x=2, y=1”).C. The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”.In addition, each value appears twice (for example, “x=1, y=1” followed by “x=1, y=1”).D. The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears only for once (for example, “x=1, y=1”followed by “x=2, y=2”).Answer: DQUESTION NO: 107Given:1. public class SyncTest {2. private int x;3. private int y;4. public synchronized void setX (int i) (x=1;)5. public synchronized void setY (int i) (y=1;)6. public synchronized void setXY(int 1)(set X(i); setY(i);)7. public synchronized Boolean check() (return x !=y;)8. )Under which conditions will check () return true when called from a different class?A. Check() can never return true.B. Check() can return true when setXY is called by multiple threads.C. Check() can return true when multiple threads call setX and setY separately.D. Check() can only return true if SyncTest is changed to allow x and y to be set separately. Answer: AQUESTION NO: 108Which is a method of the MouseMotionListener interface?A. Public void mouseDragged(MouseEvent)B. Public boolean mouseDragged(MouseEvent)C. Public void mouseDragged(MouseMotionEvent)D. Public boolean MouseDragged(MouseMotionEvent)E. Public boolean mouseDragged(MouseMotionEvent)Answer: AQUESTION NO: 109Given:1. String foo = “base”;2. foo.substring(0,3);3. foo.concat(“ket”);4. foo += “ball”;5.Type the value of foo at line 8.Answer: BASEBALLQUESTION NO 110Given:1. public class Test {2. public static void leftshift(int i, int j) {3. i<<=j;4. }5. public static void main(String args[]) {6. int i = 4, j = 2;7. leftshift(i, j);8. System.out.printIn(i);9. }10. }What is the result?A. 2B. 4C. 8D. 16E. The code will not compile.Answer: BQUESTION NO 111Given:1. public class Foo {2. private int val;3. public foo(int v) (val = v;) }4. public static void main (String [] args) {5. Foo a = new Foo (10);6. Foo b = new Foo (10);7. Foo c = a;8. int d = 10;9. double e = 10.0;10. }11. }Which three logical expression evaluate to true? (Choose Three)A. (a ==c)B. (d ==e)C. (b ==d)D. (a ==b)E. (b ==c)F. (d ==10.0)Answer: A, B, FQUESTION NO 112Exhibit:1. public class X {2. private static int a;3.5. public static void main (String[] args) {6. modify (a);7. }8.9. public static void modify (int a) {10. a++;11. }12. }What is the result?A. The program runs and prints “0”B. The program runs and prints “1”C. The program runs but aborts with an exception.D. En error “possible undefined variable” at line 5 causes compilation to fail.F. En error “possible undefined variable” at line 10 causes compilation to fail. Answer: AQUESTION NO 113Exhibit:1. public class Test {2. public static void replaceJ(string text) {3. text.replace (‘j’, ‘l’);4. }5.6. public static void main(String args[]) {7. string text = new String (“java”)8. replaceJ(text);9. system.out.printIn(text);10. }11. }What is the result?A. The program prints “lava”B. The program prints “java”C. An error at line 7 causes compilation to fail.D. Compilation succeeds but the program throws an exception. Answer: BQUESTION NO 114Which two are equivalent? (Choose Two)A. 3/2B. 3<2C. 3*4D. 3<<2E. 3*2^2F. 3<<<2Answer: C, DQUESTION NO 115What is the numerical range of a char?A. 0 . . . 32767B. 0 . . . 65535C. ?256 . . . 255D. ?32768 . . . 32767E. Range is platform dependent.Answer: BQUESTION NO 116Given:1. public class Test {2. public static void main (String []args) {3. unsigned byte b = 0;4. b--;5.6. }7. }What is the value of b at line 5?A. -1B. 255C. 127D. Compilation will fail.E. Compilation will succeed but the program will throw an exception at line 4.Answer: DQUESTION NO 117Given:1. public class Foo {2. public void main (String [] args) {3. system.out.printIn(“Hello World.”);4. }5. }What is the result?A. An exception is thrown.B. The code does no compile.C. “Hello World.” Is printed to the terminal.D. The program exits without printing anything.Answer: AQUESTION NO 118Given:1. //point X2. public class foo (3. public static void main (String[]args) throws Exception {4. java.io.printWriter out = new java.io.PrintWriter (5. new java.io.outputStreamWriter (System.out), true;6. out.printIn(“Hello”);7. }8. }Which statement at PointX on line 1 allows this code to compile and run?A. Import java.io.*;B. Include java.io.*;C. Import java.io.PrintWriter;D. Include java.io.PrintWriter;E. No statement is needed.Answer: EQUESTION NO 119Which will declare a method that is available to all members of the same package and can be referencedwithout an instance of the class?A. Abstract public void methoda();B. Public abstract double methoda();C. Static void methoda(double d1){}D. Public native double methoda() {}E. Protected void methoda(double d1) {}Answer: CQUESTION NO 120Which type of event indicates a key pressed on a ponent?A. KeyEventB. KeyDownEventC. KeyPressEventD. KeyTypedEventE. KeyPressedEventAnswer: AQUESTION NO 121Exhibit:1. import java.awt.*;2.3. public class X extends Frame {4. public static void main (String [] args) {5. X x = new X();6. x.pack();7. x.setVisible(true);8. }9.10. public X() {11. setLayout (new BordrLayout());12. Panel p = new Panel ();13. add(p, BorderLayout.NORTH);14. Button b = new Button (“North”);15. p.add(b):16. Button b = new Button (“South”);17. add(b1, BorderLayout.SOUTH):18. }19. }Which two statements are true? (Choose Two)A. The buttons labeled “North” and “South” will have the s ame width.B. The buttons labeled “North” and “South” will have the same height.C. The height of the button labeled “North” can very if the Frame is resized.D. The height of the button labeled “South” can very if the Frame is resized.E. The width of the button labeled “North” is constant even if the Frame is resized.F. The width of the button labeled “South” is constant even if the Frame is resized. Answer: B, EQUESTION NO 122How can you create a listener class that receives events when the mouse is moved?A. By extending MouseListener.B. By implementing MouseListener.C. By extending MouseMotionListener.D. By implementing MouseMotionListener.E. Either by extending MouseMotionListener or extending MouseListener.F. Either by implementing MouseMotion Listener or implementing MouseListener.Answer: DQUESTION NO 123Which statement is true?A. A grid bag layout can position components such that they span multiple rows and/or columns.B. The “North” region of a border layout is the proper place to locat e a menuBar component in a Frame.C. Components in a grid bag layout may either resize with their cell, or remain centered in that cell attheir preferred size.D. A border layout can be used to position a component that should maintain a constant size evenwhen the container is resized.Answer: AQUESTION NO 124You want a class to have access to members of another class in the same package. Which is the mostrestrictive access modifier that will accomplish that will accomplish this objective?A. PublicB. PrivateC. ProtectedD. TransientE. No access modifier is required.Answer: EQUESTION NO 125Which two statements are true regarding the creation of a default constructor? (Choose Two)A. The default constructor initializes method variables.B. The default constructor invokes the no-parameter constructor of the superclass.C. The default constructor initializes the instance variables declared in the class.D. If a class lacks a no-parameter constructor,, but has other constructors, the compiler creates a default constructor.E. The compiler creates a default constructor only when there are no other constructors for the class.Answer: C, EQUESTION NO 126Given:1. public class OuterClass {2. private double d1 1.0;3. //insert code here4. }You need to insert an inner class declaration at line2. Which two inner class declarations are valid?(Choose Two)A. static class InnerOne {public double methoda() {return d1;}}B. static class InnerOne {static double methoda() {return d1;}}C. private class InnerOne {public double methoda() {return d1;}}D. protected class InnerOne {static double methoda() {return d1;}}E. public abstract class InnerOne {public abstract double methoda();}Answer: C, EQUESTION NO 127Which two declarations prevent the overriding of a method? (Choose Two)A. Final void methoda() {}B. Void final methoda() {}C. Static void methoda() {}D. Static final void methoda() {}E. Final abstract void methoda() {}Answer: A, DQUESTION NO 128Given:1. public class Test {2. public static void main (String args[]) {3. class Foo {4. public int i = 3;5. }6. Object o = (Object) new Foo();7. Foo foo = (Foo)o;8. System.out.printIn(foo. i);9. }10. }What is the result?A. Compilation will fail.B. Compilation will succeed and the progr am will print “3”C. Compilation will succeed but the program will throw a ClassCastException at line 6.D. Compilation will succeed but the program will throw a ClassCastException at line 7. Answer: BQUESTION NO 129Which two create an instance of an array? (Choose Two)A. int[] ia = new int [15];B. float fa = new float [20];C. char*+ ca = “Some String”;D. Object oa = new float[20];E. Int ia [][] = (4, 5, 6) (1, 2, 3)Answer: A, DQUESTION NO 130Given:1. public class ExceptionTest {2. class TestException extends Exception {}3. public void runTest () throws TestException {}4. public void test () /* Point X*/ {5. runTest ();6. }7. }At point X on line 4, which code can be added to make the code compile?A. Throws Exception.B. Catch (Exception e).C. Throws RuntimeException.D. Catch (TestException e).E. No code is necessary.Answer: BQUESTION NO 131Exhibit:1. public class SwitchTest {2. public static void main (String []args) {3. System.out.PrintIn(“value =” +switchIt(4));4. }5. public static int switchIt(int x) {6. int j = 1;7. switch (x) {8. case 1: j++;9. case 2: j++;10. case 3: j++;11. case 4: j++;12. case 5: j++;13. default:j++;14. }15. return j + x;16. }17. }What is the output from line 3?A. Value = 3B. Value = 4C. Value = 5D. Value = 6E. Value = 7F. Value = 8Answer: FQUESTION NO 132Which four types of objects can be thrown using the throw statement? (Choose Four)A. ErrorB. EventC. ObjectD. ExceptionE. ThrowableF. RuntimeExceptionAnswer: A, D, E, FQUESTION NO 133Given:1. public class ForBar {2. public static void main(String []args) {3. int i = 0, j = 5;4. tp: for (;;) {5. i ++;6. for(;;)7. if(i > --j) break tp;8. }9. system.out.printIn(“i = ” + i + “, j = “+ j);10. }11. }What is the result?A. The program runs and prints “i=1, j=0”B. The program runs and prints “i=1, j=4”C. The program runs and prints “i=3, j=4”D. The program runs and prints “i=3, j=0”E. An error at line 4 causes compilation to fail.F. An error at line 7 causes compilation to fail.Answer: AQUESTION NO 134Which two can directly cause a thread to stop executing? (Choose Two)A. Exiting from a synchronized block.B. Calling the wait method on an object.C. Calling the notify method on an object.D. Calling the notifyAll method on an object.E. Calling the setPriority method on a thread object.Answer: B, EQUESTION NO 135Given:1. public class Foo implements Runnable (2. public void run (Thread t) {3. system.out.printIn(“Running.”);4. }5. public static void main (String[] args) {6. new thread (new Foo()).start();7. )8. )What is the result?A. An exception is thrown.B. The program exists without printing anything.C. An error at line 1 causes compilation to fail.D. An error at line 6 causes the compilation to fail.E. “Running” is printed and the program exits. Answer: CQUESTION NO 136Which constructs a DataOutputStream?A. New dataInputStream(“in.txt”);B. New dataInputStream(new file(“in.txt”));C. New dataInputStream(new writer(“in.txt”));D. New dataInputSt ream(new FileWriter(“in.txt”));E. New dataInputStream(new InputStream(“in.txt”));F. New dataInputStream(new FileInputStream(“in.txt”)); Answer: FQUESTION NO 137Which can be used to decode charS for output?A. Java.io.InputStream.B. Java.io.EncodedReader.C. Java.io.InputStreamReader.D. Java.io.InputStreamWriter.E. Java.io.BufferedInputStream.Answer: CQUESTION NO 138Given:1. public class Test {2. public static void main (String [] args) {3. string foo = “blue”;4. string bar = foo;5. foo = “green”;6. System.out.printIn(bar);7. }8. }What is the result?A. An exception is thrown.B. The code will not compile.C. The program prints “null”D. The program prints “blue”E. The program prints “green”Answer: DQUESTION NO 139Which code determines the int value foo closest to a double value bar?A. Int foo = (int) Math.max(bar);B. Int foo = (int) Math.min(bar);C. Int foo = (int) Math.abs(bar);D. Int foo = (int) Math.ceil(bar);E. Int foo = (int) Math.floor(bar);F. Int foo = (int) Math.round(bar);Answer: FQUESTION NO 140Which two demonstrate encapsulation of data? (Choose Two)A. Member data have no access modifiers.B. Member data can be modified directly.C. The access modifier for methods is protected.D. The access modifier to member data is private.E. Methods provide for access and modification of data.Answer: D, EQUESTION NO 141Exhibit:1. class A {2. public String toString () {3. return “4”;4. }5. }6. class B extends A {7. 8. public String toString () {8. return super.toString() + “3”;9. }10. }11. public class Test {12. public static void main(String[]args) {13. System.out.printIn(new B());14. }15. }What is the result?A. Compilation succeeds and 4 is printed.B. Compilation succeeds and 43 is printed.C. An error on line 9 causes compilation to fail.D. An error on line 14 causes compilation to fail.E. Compilation succeeds but an exception is thrown at line 9.Answer: BQUESTION NO 142Which two statements are true? (Choose Two)A. An anonymous inner class can be declared inside of a methodB. An anonymous inner class constructor can take arguments in some situation.C. An anonymous inner class that is a direct subclass that is a direct subclass of Object can implementmultiple interfaces.D. Even if a class Super does not implement any interfaces, it is still possible to define an anonymousinner class that is an immediate subclass of Super that implements a single interface.E. Event if a class Super does not implement any interfaces, it is still possible to define an anonymousinner class that is an immediate subclass of Super that implements multiple interfaces. Answer: A, BQUESTION NO 143Given:1. public class MethodOver {2. private int x, y;3. private float z;4. public void setVar(int a, int b, float c){5. x = a;6. y = b;7. z = c;8. }9. }Which two overload the setVar method? (Choose Two)A. void setVar (int a, int b, float c){x = a;y = b;z = c;}B. public void setVar(int a, float c, int b) {setVar(a, b, c);}C. public void setVar(int a, float c, int b) {this(a, b, c);}D. public void setVar(int a, float b){x = a;z = b;}E. public void setVar(int ax, int by, float cz) {x = ax;y = by;z = cz;}Answer: B, DQUESTION NO 144Which statements about static inner classes are true? (Choose Two)A. A static inner class requires a static initializer.B. A static inner class requires an instance of the enclosing class.C. A static inner class has no reference to an instance of the enclosing class.D. A static inner class has access to the non-static members of the outer class.E. Static members of a static inner class can be referenced using the class name of the static inner class.Answer: C, EQUESTION NO 145Given:1. public class X {2. public object m () {3. object o = new float (3.14F);4. object [] oa = new object [1];5. oa[0]= o;6. o = null;7. oa[0] = null;9. return o;9. }10. }When is the float object created in line 3, eligible for garbage collection?A. Just after line 5.B. Just after line 6.C. Just after line 7.D. Just after line 8(that is, as the method returns).Answer: CQUESTION NO 146Which two interfaces provide the capability to store objects using a key-value pair? (Choose Two)A. Java.util.Map.B. Java.util.Set.C. Java.util.List.D. Java.util.StoredSet.E. Java.util.StoredMap.F. Java.util.Collection.Answer: A, EQUESTION NO 147Which interface does java.util.Hashable implement?A. Java.util.Map.B. Java.util.List.C. Java.util.Hashable.D. Java.util.Collection. Answer: A。
2023年9月GESP编程能力认证C++等级考试二级真题(含答案)
2023年9月GESP编程能力认证C++等级考试二级真题(含答案)一、单选题(每题2分,共30分)。
1.我国第一台大型通用电子计算机使用的逻辑部件是()。
A. 集成电路B. 大规模集成电路C. 晶体管D. 电子管标准答案:D。
2.下列流程图的输出结果是()。
标准答案:B。
3.如果要找出整数a,b中较大一个,通常要用下面哪种程序结构?()。
A. 顺序结构B. 循环结构C. 分支结构D. 跳转结构标准答案:C。
4.以下不是C++关键字的是()。
A. continueB. coutC. breakD. goto标准答案:B。
5.题C++表达式int(-123.123 / 10)的值是()。
A. -124B. -123C. -13D. -12标准答案:D。
6.以下C++代码实现从大到小的顺序输出N的所有因子。
例如,输入N = 18时输出18 9 6 3 2 1,横线处应填入()。
标准答案:C。
7.如下图所示,输出N行N列的矩阵,对角线为1,横线处应填入()。
标准答案:D。
8.下面C++代码用于判断N是否为质数(素数),约定输入N为大于等于2的正整数,请在横线处填入合适的代码()。
A. breakB. continueC. exitD. return标准答案:A。
9.下面C++代码执行后的输出是()。
A. 1#0B. 1#C. 1#1#1#1#1#1D. 1#1#1#1#1#1#0标准答案:D。
10.下面C++代码执行后的输出是()。
A. 16B. 28C. 35D. 36标准答案:A。
11.下面C++代码执行后的输出是()。
A. 1B. 3C. 15D. 没有输出标准答案:B。
12.下面C++代码执行后的输出是()。
标准答案:B 。
13.下面图形每一行从字母A 开始,以ABC 方式重复。
行数为输入的整数。
请在C++代码段横线处填入合适代码()。
标准答案:D 。
14.输入行数,约定1≤lineCount ≤9,输出以下图形。
二级技师考试题库及答案
二级技师考试题库及答案一、单项选择题(每题2分,共20分)1. 在机械加工中,以下哪个因素对工件表面粗糙度影响最大?A. 刀具材料B. 切削速度C. 刀具的几何角度D. 工件材料答案:B2. 以下哪种焊接方法适用于不锈钢材料?A. 电弧焊B. 激光焊C. 氩弧焊D. 氧乙炔焊答案:C3. 在数控编程中,G代码中的G00代表什么?A. 直线插补B. 圆弧插补C. 快速定位D. 暂停答案:C4. 以下哪个是三相异步电动机的启动方式?A. 直接启动B. 星-三角启动C. 变频启动D. 降压启动答案:B5. 在电气控制系统中,继电器的主要作用是什么?A. 过载保护B. 短路保护C. 隔离和控制电路D. 电压转换答案:C6. 以下哪种材料不适合用于制作高温环境下的零件?A. 不锈钢B. 铝合金C. 钛合金D. 铸铁答案:D7. 在液压系统中,节流阀的作用是什么?A. 控制压力B. 控制流量C. 控制方向D. 释放压力答案:B8. 以下哪种传感器适用于测量物体的位移?A. 温度传感器B. 压力传感器C. 位移传感器D. 速度传感器答案:C9. 在机械设计中,以下哪种轴承适用于承受径向负荷?A. 深沟球轴承B. 圆锥滚子轴承C. 推力球轴承D. 角接触球轴承答案:A10. 以下哪种材料最适合用于制造承受高压力的密封件?A. 橡胶B. 聚四氟乙烯C. 尼龙D. 金属答案:B二、多项选择题(每题3分,共15分)1. 以下哪些因素会影响机械加工精度?A. 机床精度B. 刀具磨损C. 工件材料硬度D. 操作者技能答案:ABCD2. 以下哪些是数控机床的主要组成部分?A. 控制系统B. 驱动系统C. 传动系统D. 操作面板答案:ABCD3. 在电气控制系统中,以下哪些元件可以用于实现电路的保护?A. 熔断器B. 过载继电器C. 断路器D. 接触器答案:ABC4. 以下哪些是液压系统中常见的故障?A. 油泵故障B. 油缸泄漏C. 管路堵塞D. 电磁阀卡滞答案:ABCD5. 在机械设计中,以下哪些因素会影响轴承的寿命?A. 负荷大小B. 转速高低C. 润滑状况D. 轴承材料答案:ABCD三、判断题(每题1分,共10分)1. 所有金属材料都具有良好的导电性。
SCJP题库
yModule 1-JAVA 基础一、选择题:Question 1Given:35. String #name = "Jane Doe";36. int $age=24;37. Double _height = 123.5;38. double ~temp = 37.5;Which two are true? (Choose two.)A. Line 35 will not compile.B. Line 36 will not compile.C. Line 37 will not compile.D. Line 38 will not compile.Answer: AD 标识符以字母,下划线,或者$开始Question 2Given:11. public class Test {12. public static void main(String [] args) {13. int x =5;14. boolean b1 = true;15. boolean b2 = false;16.17.if((x==4) && !b2)18. System.out.print("l ");19. System.out.print("2 ");20. if ((b2 = true) && b1)21. System.out.print("3");22. }23. }What is the result?A. 2B. 3C. 1 2D. 2 3E. 1 2 3F. Compilation fails.G. An exceptional is thrown at runtime.Answer: D 注意20行,=为赋值,不要被骗Question 3Given:42. public class ClassA {43. public int getValue() {44. int value=0;45. boolean setting = true;46. String title="Hello";47. if (value || (setting && title == "Hello")) { return 1; }48. if (value == 1 & title.equals("Hello")) { return 2; }49. }50. }And:70. ClassA a = new ClassA();71. a.getValue();What is the result?A. 1B. 2C. Compilation fails.D. The code runs with no output.E. An exception is thrown at runtime.Answer: C 编译不通过,47行value为int类型不是booleanQuestion 4Given:11. public void testIfA() {12. if(testIfB("True")) {13. System.out.println("True");14. } else {15. System.out.println("Not true");16. }17. }18. public Boolean testIfB(String str) {19. return Boolean.valueOf(str);20. }What is the result when method testIfA is invoked?A. TrueB. Not trueC. An exception is thrown at runtime.D. Compilation fails because of an error at line 12.E. Compilation fails because of an error at line 19. Answer: A 19行,如果str为true则返回ture,否则返回falseQuestion 5Given:11. public static void main(String[] args) {12. Integer i = new Integer(1) + new Integer(2);13. switch(i) {14. case 3: System.out.println("three"); break;15. default: System.out.println("other"); break;16. }17. }What is the result?A. threeB. otherC. An exception is thrown at runtime.D. Compilation fails because of an error on line 12.E. Compilation fails because of an error on line 13.F. Compilation fails because of an error on line 15. Answer: A 就是两个Integer类型相加Question 6Given:11. public static void main(String[] args) {12. String str = "null";13. if (str == null) {14. System.out.println("null");15. } else (str.length() == 0) {16. System.out.println("zero");17. } else {18. System.out.println("some");19. }20. }‘What is the result?A. nullB. zeroC. someD. Compilation fails.E. An exception is thrown at runtime. Answer: D 这题真恶心 15行少个ifQuestion 7Given:10.int x=0;11.int y=10;12. do {l3. y--;14. ++x;15. } while (x < 5);16. System.out.print(x + "," + y);What is the result?A. 5,6B. 5,5C. 6,5D. 6,6Answer: B (91,82,73,64,55)没啥争议Question 8Given:25.int x=12;26. while (x < 10) {27. x--;28. }29. System.out.print(x);What is the result?A. 0B. 10C. 12D. Line 29 will never be reached. Answer: C 12>10,所以直接跳出循环,输出x=12 Question 9Given:35. int x= 10;36. do {37. x--;38. } while(x< 10);How many times will line 37 be executed?A. ten timesB. zero timesC. one to me timesD. more than ten timesAnswer: D 死循环Question 10Given:11. public static void main(String[] args) {12. for (int i=0;i<= 10;i++){13. if( i>6) break;14. }15. System.out.println(i);16. }What is the result?A. 6B. 7C. 10D. 11E. Compilation fails.F. An exception is thrown at runtime.Answer: E 15行i超出了作用域Question 11Given:55. int []x= {1, 2,3,4, 5};56. int y[] =x;57. System.out.println(y[2]);Which is true?A. Line 57 will print the value 2.B. Line 57 will print the value 3.C. Compilation will fail because of an error in line 55.D. Compilation will fail because of an error in line 56.Answer: B 没争议,考察数组下标是从0开始Question 12Which two code fragments(片段) correctly(正确) create and initialize a static array of int elements? (Choose two.)A. static final int[] a = { 100,200 };B. static final int[] a;static { a=new int[2]; a[0]=100; a[1]=200; }C. static final int[] a = new int[2] { 100,200 };D. static final int[] a;static void init() { a = new int[3]; a[0]=100; a[1]=200; }Answer: AB c不能指定长度,d不能在init方法中赋值,要么在static代码块中Question 13Given:11. public static void main(String[] args) {12. Object obj = new int[] { 1,2,3 };13. int[] someArray = (int[])obj;14. for (int i: someArray) System.out.print(i +" ")15. }‘What is the result?A. 1 2 3B. Compilation fails because of an error in line 12.C. Compilation fails because of an error in line 13.D. Compilation fails because of an error in line 14.E. A ClassCastException is thrown at runtime.Answer: A 没争议,foeach循环遍历数组Question 14Given:11. String[] elements = { "for", "tea", "too" };12. String first = (elements.length > 0)? elements[0] : null;What is the result?A. Compilation fails.B. An exception is thrown at runtime.C. The variable first is set to null.D. The variable first is set to elements[0].Answer: DQuestion 15Given:10. public class Bar {11.static void foo(int...x) {12. // insert code here13. }14. }Which two code fragments, inserted independently(独立的) at line 12, will allow the class to compile? (Choose two.)A. foreach(x) System.out.println(z);B. for(int z : x) System.out.println(z);C. while( x.hasNext()) System.out.println( x.next());D. for( int i=0; i< x.length; i++ ) System.out.println(x[i]); Answer: BD x相当于一个数组,a明显错没有foreach,c中x没有hadNext方法Question 16A programmer(程序员) needs to create a logging method that can accept (接受) an arbitrary(随意任意) number of arguments. For example, it may be called in theseways:logIt("log message 1 ");logIt("log message2”,”log message3");logIt("log message4", "log message5", "log message6");Which declaration(说明) satisfies(符合) this requirement(需求)?A. public void logIt(String * msgs)B. public void logIt(String [] msgs)C. public void logIt(String... msgs)D. public void logIt(String msg1, String msg2, String msg3)Answer: C 可变长参数Question 171. public class A {2. public String doit(int x, int y) {3. return "a";4. }5.6. public String doit(int... vals) {7. return "b";8. }9. }Given:25. A a=new A();26. System.out.println(a.doit(4, 5));What is the result?A. Line 26 prints "a" to System.out.B. Line 26 prints "b" to System.out.C. An exception is thrown at line 26 at runtime.D. Compilation of class A will fail due to an error in line 6. Answer: A 确定参数和可变长参数同时存在的时候,优先考虑确定参数的Question 18Given a file GrizzlyBear.java:1. package animals.mammals;2.3. public class GrizzlyBear extends Bear {4. void hunt() {5. Salmon s = findSalmon();6. s.consume();7. }8. }and another file, Salmon.java:1. package animals.fish;2.3. public class Salmon extends Fish {4. void consume() { /* do stuff */ }5. }Assume(假定) both classes are defined in the correct directories for theft packages, and that the Mammal class correctly defines the findSalmon() method. Which two changes allow this code to compile correctly? (Choose two.)A. add public to the start of line 4 in Salmon.javaB. add public to the start of line 4 in GrizzlyBear.javaC. add import animals.mammals.*; at line 2 in Salmon.javaD. add import animals.fish.*; at line 2 in GrizzlyBear.javaE. add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.javaF. add import animals.mammals.GrizzlyBear.*;at line 2 in Salmon.java Answer: AD 调用不同包下的类,要先导入,方法权限要设置成publicQuestion 19Given:10. package com.sun.scjp;11. public class Geodetics {12. public static final double DIAMETER = 12756.32; // kilometers13. }Which two correctly access(访问) the DIAMETER member of the Geodetics class? (Choose two.)A. import com.sun.scjp.Geodetics;public class TerraCarta {public double halfway(){ return Geodetics.DIAMETER/2.0; } }B. import static com.sun.scjp.Geodetics;public class TerraCarta {public double halfway() { return DIAMETER/2.0; } }C. import static com.sun.scjp.Geodetics. *;public class TerraCarta {public double halfway() { return DIAMETER/2.0; } }D. package com.sun.scjp;public class TerraCarta {public double halfway() { return DIAMETER/2.0; } }Answer: AC b中不能静态导入类,c中静态导入类属性,正确,d访问错误很明显Question 20Given classes defined in two different files:1. package util;2. public class BitUtils {3. private static void process(byte[] b) { }4. }1. package app;2. public class SomeApp {3. public static void main(String[] args) {4. byte[] bytes = new byte[256];5. // insert code here6. }7. }What is required(必需的) at line 5 in class SomeApp to use the process methodof BitUtils?A. process(bytes);B. BitUtils.process(bytes);C. app.BitUtils.process(bytes);D. util.BitUtils.process(bytes);E. import util.BitUtils. *; process(bytes);F. SomeApp cannot use the process method in BitUtils.Answer: F 私有的,不能被访问Question 21Given a class Repetition(重复):1. package utils;2.3. public class Repetition {4. public static String twice(String s) { return s + s; }5. }and given another class Demo:1. // insert code here2.3. public class Demo {4. public static void main(String[] args) {5. System.out.println(twice("pizza"));6. }7. }Which code should be inserted at line 1 of Demo.java to compile and run Demo to print “pizzapizza”?A. import utils.*;B. static import utils.*;C. import utils.Repetition.*;D. static import utils.Repetition. *;E. import utils.Repetition.twice();F. import static utils.Repetition.twice;G. static import utils.Repetition.twice;Answer: F 静态导入Question 22Given:1. package test;2.3. class Target(目标) {4. public String name = "hello";5. }What can directly(直接的) access and change the value of the variable (变量) name?A. any classB. only the Target classC. any class in the test packageD. any class that extends TargetAnswer: C default类型的类本包访问权限Question 23Given:11. rbo = new ReallyBigObject();12. // more code here13. rbo = null;14. /* insert code here */Which statement(语句) should be placed at line 14 to suggest(促成) that the virtual machine(虚拟机) expend(消耗) effort(努力) toward recycling (回收) the memory used by the object rbo?A. System.gc();B. Runtime.gc();C. System.freeMemory();D. Runtime.getRuntime().growHeap();E. Runtime.getRuntime().freeMemory();Answer: A 题很简单。
2024年3月GESP编程能力认证C++等级考试二级真题(含答案)
2024年3月GESP编程能力认证C++等级考试二级真题(含答案) 一、单选题(每题2分,共30分)。
1.下列流程图的输出结果是()。
A. 优秀B. 良好C. 不及格D. 没有输出2.以下选项中不符合C++变量命名规则的是()。
A. studentB. 2_fromC. _toD. Text3.以下选项中,不能用于表示分支结构的C++保留字是()。
A. switchB. returnC. elseD. if4.下列说法错误的是()。
A. while循环满足循环条件时不断地运行,直到指定的条件不满足为止。
B. if语句通常用于执行条件判断。
C. 在C++中可以使用foreach循环。
D. break和continue语句都可以用在for循环和while循环中。
5.下列4个表达式中,答案不是整数8的是()。
6.下面C++代码执行后的输出是()。
A.8B. 14C. 26D. 507.下面C++代码执行后的输出是()。
A.16B. 36C. 49D. 818.下面C++代码执行后的输出是()。
A. 2B. 3C. 4D. 59.下面C++代码执行后的输出是()。
A. 5B. 6C. 7D. 810.以下C++代码判断一个正整数N的各个数位是否都是偶数。
如果都是,则输出“是”,否则输出“否”。
例如N=2024时输出“是”,则横线处应填入()。
A.breakB. continueC. N=N/10D. N=N%1011.有句俗话叫“三天打渔,两天晒网”。
如果小杨前三天打渔,后两天晒网,一直重复这个过程,以下程序代码用于判断,第n天小杨是在打鱼还是晒网,横线处应填写()。
A.i==0B. i==4C. i==0&&i==4D. i==0||i==412.一个数的所有数字倒序排列后这个数的大小保持不变,这个数就是回文数,比如101与6886都是回文数,而100不是回文数。
以下程序代码用于判断一个数是否为回文数,横线处应填写()。
Sun认证Java程序员SCJP考试科目介绍
Sun认证Java程序员SCJP考试科目介绍
Sun认证Java程序员(SCJP)考试科目介绍
考试科目:Sun Certified Programmer for Java 2 Platform 1.2 考试编号:310-025
考试题型:59道选择题及简答题
及格标准:答对61%(36题)以上
时限:120分钟
费用:1500元
考试科目:Sun Certified Programmer for Java 2 Platform 1.4 考试编号:310-035
考试题型:59道选择题及简答题
及格标准:答对61%(36题)以上
时限:120分钟
费用:1500元
考试科目:Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0
考试编号:310-055
考试题型:72道选择题及简答题
及格标准:答对59%(43题)以上
时限:175分钟
费用:1500元
考试科目:Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 Upgrade Exam
考试编号:310-056
考试题型:46道选择题及简答题
及格标准:答对58%(27题)以上
时限:105分钟
费用:850元。
国家二级C++机试(操作题)模拟试卷547(题后含答案及解析)
国家二级C++机试(操作题)模拟试卷547(题后含答案及解析) 全部题型 2. 基本操作题 3. 简单应用题 4. 综合应用题基本操作题1.使用VC6打开考生文件夹下的源程序文件modi1.cpp,但该程序运行时有错,请改正程序中的错误,使程序输出的结果为: 1 5 1 注意:错误的语句在//******error******的下面,修改该语句即可。
1 #include <iostream.h>2 //******error******3 enum4 {5 Sun,6 Mon,7 Tue,8 Wed,9 Thu,10 Fri,11 Sat,12 //******error******13 } MyEnum;14 struct struct15 {16 //******error******17 int Fri,18 int Sun;19 };20 void main( )21 {22 int i=Mon;23 MyEnum t=Fri;24 Struct str1;25 str1.Fri=Monj26 cout<<i<<end1;27 cout<<t<<end1;28 cout <<str1.Fri<<end1;29 }正确答案:(1)enum MyEnum(2) };(3)int Fri;解析:程序当中定义了一个结构体和枚举类型,结构体含有两个整型变量,枚举类型含有7个枚举元素,7个枚举元素的值从0变化至6,即Sun=0,Mon=1,Tue=2,Wed=3,Thu=4,Fri=5,Sat=6。
(1)第一标识下声明枚举类型,声明枚举类型的一般形式为:“enum<枚举类型名>{<枚举常量列表>};”,程序当中把枚举类型名MyEnum放到枚举声明后面,显然不符合枚举类型声明格式,因此第1个标识下应改成“enum MyEnum”。
(2)由(1)的分析可知,第2个标识下也不符合枚举类型声明格式,应以“;”结束,即第2个标识下应改为“};”。
资料全国青少年软件编程(Python)等级考试试卷(2级)word程序填空阅读填空程序试题
资料全国青少年软件编程(Python)等级考试试卷(2级)word程序填空阅读填空程序试题一、程序填空1.现在有一个程序用来解决以下问题:如果有总量共1020个西瓜,第一天卖掉总数的一半后多卖出了两个,以后每天卖剩下的一半多两个,那么几天以后卖完呢?请将下列程序补充完整。
tc=1020c=0while ______________ :tc=tc-(tc/2+2)_____________print(c)2.将下列程序代码补充完整:某同学参加了学校体检,体检的医生告诉他体重超重,需要加强运动。
该同学了解到运动时,心率如能控制在一定范围内,对增强心血管系统和呼吸系统的功能都有很好的效果;超出范围,对身体反而会有损伤。
男最适宜运动心率=(220-年龄数-安静心率)×(60%~80%)+安静心率,女最适宜运动心率=(210-年龄数-安静心率)×(60%~80%)+安静心率,补充程序帮他(她)计算最适宜的运动心率。
age=float(input('请输入age='))HRrest=float(input('请输入HRrest='))gender=input(“请输入male or female :”)if ____________________:____________________else:_____________________low=(n-age-HRrest)*0.6+HRresthigh=(n-age-HRrest)*0.8+HRrestprint('最适宜的心率是:',low,'~',high)input(“运行完毕,请按回车键退出...”)3.阅读程序。
分析有关多项式的代码并回答问题。
求1!+2!+3!+……+20!的和。
n=0s=0t=1for n in range(1,21):t*=ns+=tprint(s)(1)n的作用是________________。
技能认证热注专业考试(习题卷51)
技能认证热注专业考试(习题卷51)说明:答案和解析在试卷最后第1部分:单项选择题,共57题,每题只有一个正确答案,多选或少选均不得分。
1.[单选题]( )可导致交流接触器铁芯噪音过大。
A)短路环断裂B)反作用弹簧损坏C)操作频率过高D)过载使用2.[单选题]被测压力大于20Mpa时,用( )弹簧管。
A)合金钢B)合金铝C)磷铜D)铸铁3.[单选题]由于单位的国际符号和中文符号不应混淆,速度单位的正确表达方法是( )。
A)m/sB)m/秒C)米/sD)ms4.[单选题]点火程序控制器应能控制风机,使其在锅炉点火之前,先启动风机运行使炉膛内至少有( )次循环通风。
A)1B)2C)3D)45.[单选题]允许的尺寸变动量称为( )。
A)尺寸公差B)尺寸偏差C)极限偏差D)基本偏差6.[单选题]测定给水硬度的目的是为了掌握软水器的工作情况,其测定方法是( )。
A)EDTA滴定法B)HCl滴定法C)硫酸滴定法D)氨水滴定法7.[单选题]对于燃油和燃气油田注汽锅炉,燃料中几乎不含灰分,所以( )和机械不完全燃烧热损失很小。
C)灰渣物理热损失D)机械不完全燃烧热损失8.[单选题]角频率是指正弦量在一秒内经过的( )。
A)周期B)弧度数C)路程D)位移9.[单选题]水垢包括碳酸盐、硫酸盐、硅酸盐水垢、混合水垢及( )。
A)含钾水垢B)含油水垢C)含铝水垢D)含钠水垢10.[单选题]注汽前对地面管线进行预热和冲洗,冲洗量为冲洗管线容积的( )为宜。
A)2~3倍B)1~2倍C)3~4倍D)4~5倍11.[单选题]利用蒸汽和凝结水热动力特性工作的是( )疏水阀。
A)机械型B)热力型C)恒温型D)重力型12.[单选题]我国根据具体环境条件的不同,安全电压值规定为:在无高度触电危险的建筑物中为( )伏。
A)65B)75C)55D)8513.[单选题]BB014 螺杆式压缩机的体积只有相同容量活塞式压缩机的( )。
A)四分之一多B)四分之一到六分之一C)不到六分之一D)以上都不是14.[单选题]SWP温度表CLK等于( )时,可进入二级参数设定。
国家二级C++机试(选择题)模拟试卷310(题后含答案及解析)
国家二级C++机试(选择题)模拟试卷310(题后含答案及解析) 题型有:1.1.下列关于栈的描述中错误的是A.栈是先进后出的线性表B.栈只能顺序存储C.栈具有记忆作用D.对栈的插入与删除操作中,不需要改变栈底指针正确答案:B解析:栈是限定在一端进行插入与删除的线性表。
栈顶(top):插入数据(即入栈)的一端;栈底(bottom):不能入栈也不能出栈的…端。
栈存储数据的原则:“先进后出”或“后进先出”。
栈的特性是具有记忆作用。
知识模块:数据结构与算法2.对长度为n的线性表进行顺序查找,在最坏情况下所需要的比较次数为( )。
A.log2nB.n/2C.nD.n+1正确答案:C解析:在进行顺序查找过程中,如果被查的元素是线性表中的最后一个元素,或者被查元素根本不在线性表中,则为了查找这个元素需要与线性表中的所有元素进行比较,这是顺序查找的最坏情况,需要比较的次数为n次。
知识模块:数据结构与算法3.待排序的关键码序列为(15,20,9,30,67,65,45,90),要按关键码值递增的顺序排序,采取简单选择排序法,第一趟排序后关键码15被放到第( )个位置。
A.2B.3C.4D.5正确答案:A解析:选择排序的基本思想是扫描整个线性表,从中选出最小的元素,将它交换到表的最前面,然后对剩下的子表采用同样的方法,直到子表为空。
所以第一趟排序后,将选出最小的元素9放在第一一个位置,元素15则放在第二个位置。
4.从工程管理角度看,软件设计一般分为两步完成,它们是( )。
A.概要设计与详细设计B.数据设计与接口设计C.软件结构设计与数据设计D.过程设计与数据设计正确答案:A解析:软件设计是开发阶段最重要的步骤。
从工程管理的角度来看可分为两步:概要设计和详细设计。
概要设计是将软件需求转化为软件体系结构,确定系统级接口、全局数据结构或数据库模式;详细设计是指确立每个模块的实现算法和局部数据结构,用适应方法表示算法和数据结构的细节。
程序员英文考题
程序员英文考题SCJP考试题310-025原题及解答1. Which statement are characteristics of the >> and >>> operators.A. >> performs a shiftB. >> performs a rotateC. >> performs a signed and >>> performs an unsigned shiftD. >> performs an unsigned and >>> performs a signed shiftE. >> should be used on integrals and >>> should be used on floating point typesC.2. Given the following declarationString s = "Example";Which are legal code?A. s >>> = 3;B. s[3] = "x";C. int i = s.length();D. String t = "For " + s;E. s = s + 10;CDE.3. Given the following declarationString s = "hello";Which are legal code?A. s >> = 2;B. char c = s[3];C. s += "there";D. int i = s.length();E. s = s + 3;CDE.4. Which statements are true about listeners?A. The return value from a listener is of boolean type.B. Most components allow multiple listeners to be added.C. A copy of the original event is passed into a listener method.D. If multiple listeners are added to a single component, they all must all be friends to each other.E. If the multiple listeners are added to a single component, the order [in which listeners are called is guaranteed].BC.5. What might cause the current thread to stop executing.A. An InterruptedException is thrown.B. The thread executes a wait() call.C. The thread constructs a new Thread.D. A thread of higher priority becomes ready.E. The thread executes a waitforID() call on a MediaTracker.ABDE.6. Given the following incomplete method.1. public void method(){2.3. if (someTestFails()){4.5. }6.7.}You want to make this method throw an IOException if, and only if, the method someTestFails() returns a value of true.Which changes achieve this?A. Add at line 2: IOException e;B. Add at line 4: throw e;C. Add at line 4: throw new IOException();D. Add at line 6: throw new IOException();E. Modify the method declaration to indicate that an object of [type] Exception might be thrown.CE.7. Which modifier should be applied to a method for the lock of the object this to beobtained prior to executing any of the method body?A. finalB. staticC. abstractD. protectedE. synchronizedE.8. Which are keywords in Java?A. NULLB. trueC. sizeofD. implementsE. instanceofDE.9. Consider the following code:Integer s = new Integer(9);Integer t = new Integer(9);Long u = new Long(9);Which test would return true?A. (s==u)B. (s==t)C. (s.equals(t))D. (s.equals(9))E. (s.equals(new Integer(9))CE.10. Why would a responsible Java programmer want to usea nested class?A. To keep the code for a very specialized class in close association with the class it works with.B. To support a new user interface that generates custom events.C. To impress the boss with his/her knowledge of Java by using nested classes all over the place.11. You have the following code. Which numbers will cause "Test2" to be printed?switch(x){case 1:System.out.println("Test1");case 2:case 3:System.out.println("Test2");break;}System.out.println("Test3");}A. 0B. 1C. 2D. 3E. 4BCD.12. Which statement declares a variable a which is suitable for referring to an array of 50 string objects?A. char a[][];B. String a[];C. String []a;D. Object a[50];E. String a[50];F. Object a[];BCF.13. What should you use to position a Button within an application frame so that the width of the Button is affected by the Frame size but the height is not affected.A. FlowLayoutB. GridLayoutC. Center area of a BorderLayoutD. East or West of a BorderLayoutE. North or South of a BorderLayout14. What might cause the current thread to stop executing?A. An InterruptedException is thrownB. The thread executes a sleep() callC. The thread constructs a new ThreadD. A thread of higher priority becomes ready (runnable)E. The thread executes a read() call on an InputStreamABDE.Non-runnable states:* Suspended: caused by suspend(), waits for resume()* Sleeping: caused by sleep(), waits for timeout* Blocked: caused by various I/O calls or by failing to get a monitor's lock, waits for I/O or for the monitor's lock * Waiting: caused by wait(), waits for notify() or notifyAll()* Dead: Caused by stop() or returning from run(), no way out15. Consider the following code:String s = null;Which code fragments cause an object of type NullPointerException to be thrown?A. if((s!=null) & (s.length()>0))B. if((s!=null) &&(s.length()>0))C. if((s==null) | (s.length()==0))D. if((s==null) || (s.length()==0))AC.16. Given the following method body:{if (sometest()) {unsafe();}else {safe();}}The method "unsafe" might throw an IOException (which is not a subclass of RunTimeException). Which correctly completes the method of declaration when added at line one?A. public void methodName() throws ExceptionB. public void methodname()C. public void methodName() throw IOExceptionD. public void methodName() throws IOExceptionE. public IOException methodName()AD.17. What would be the result of attempting to compile and run the following piece of code?public class Test {static int x;public static void main(String args[]){System.out.println("Value is " + x);}}A. The output "Value is 0" is printed.B. An object of type NullPointerException is thrown.C. An "illegal array declaration syntax" compiler error occurs.D. A "possible reference before assignment" compiler error occurs.E. An object of type ArrayIndexOutOfBoundsException is thrown.A.18. What would be the result of attempting to compile and run the following piece of code?public class Test {public int x;public static void main(String args[]){System.out.println("Value is " + x);}}A. The output "Value is 0" is printed.B. Non-static variable x cannot be referenced from a static context..C. An "illegal array declaration syntax" compiler error occurs.D. A "possible reference before assignment" compiler error occurs.E. An object of type ArrayIndexOutOfBoundsException is thrown.B.19. What would be the result of attempting to compile and run the following piece of code?public class Test {public static void main(String args[]){int x;System.out.println("Value is " + x);}}A. The output "Value is 0" is printed.B. An object of type NullPointerException is thrown.C. An "illegal array declaration syntax" compiler error occurs.D. A "possible reference before assignment" compiler error occurs.E. An object of type ArrayIndexOutOfBoundsException is thrown.D.。
2023年下半年第二批次系统集成项目管理工程师《应用技术》计算题真题及答案解析
2023年下半年第二批次系统集成项目管理工程师《应用技术》计算题真题及答案解析【考友回忆版】计算题(25分)(关键路径法、甘特图、挣值管理、缩短工期的方法):某信息系统工程项目由ABCDEFG七个任务构成,项目组根据不同任务的特点,人员情况等,对各项任务进行了历时估算并排序,并给出了进度计划,如下图:项目中各项任务的预算(方框中,单位是万元)、从财务部获取的监控点处各项目任务的实际费用(括号中单位为万元),及各项任务在监控点时的完成情况如下图:[问题1](10分)(1)请指出该项目的关键路径、工期。
(2)本例给出的进度计划图叫什么图?还有哪几种图可以表示进度计划?3)请计算任务A、D和F的总时差和自由时差?(4)若任务C拖延1周,对项目的进度有无影响?为什么?[问题2](7分)请计算监控点时刻对应的PV、EV、AC、CV、SV、CPI和SPI。
[问题3](4分)请分析监控点时刻对应的项目绩效,并指出绩效改进的措施。
[问题4](4分)(1)请计算该项目的总预算。
(2)若在监控点时刻对项目进行了绩效评估后找到了影响绩效的原因并予以纠正,请预测此种情况下项目的ETC、EAC。
【参考答案】【问题1】(10分)(1)关键路径:BDEG,工期是24周。
(2)双代号时标网络图。
此外,还有横道图、甘特图、单代号网络图、双代号网图等。
可以表示进度计划。
(3)A的总时差为3周,A的自由时差为2周。
D的总时差和自由时差均为0周;F的自由时差和总时差均为7周。
(4)C工作有1周总时差,所以拖延1周,对项目的进度无影响。
【问题2】(7分)PV=4+10+12+4+4=34万元。
AC=3+8+16+5+4=36万元。
EV=4+10+12×0.75+4+6×0.5=30万元。
CV=EV-AC=30-36=-6万元。
SV=EV-PV=30-34=-4万元。
CPI=EV/AC=30/36=0.83。
SPI=EV/PV=30/34=0.88。
Photoshop cs2 认证考试模拟题
Photoshop cs2 认证考试题库1、在Photoshop CS2中,像素的形状只有可能是(A)A.矩形B.正方形C.圆形2、下列哪些软件的主要用途是产生像素图?(BD)A.Adobe IllustratorB.Adobe PhotoshopC.Macromedia FreehandD.Corel Painter3、在Photoshop中,下列哪种图像色彩模式可以支持48位的色彩深度?(C)A.索引色B.灰度C.RGBD.CMYK4、在RGB模式的图像中每个像素的颜色值都由R、G、B这三个数值来决定,每个数值得范围都是0~255。
当R、G、B数值相等、均为255或均为0时,最终的颜色分别是(A)A.灰色、纯白色、纯黑色B.偏色的灰色、线白色、纯黑色C.灰色、纯黑色、纯白色D.偏色的灰色、纯黑色、纯白色5、CMYK模式的图像有(D)个颜色通道。
A.1 B.2 C.3 D.46、在8位/通道的灰度图象中最多可以包含(C)中颜色信息。
A.1 B.2 C.256 D.不确定7、图中所显示的中文字体名称都以英文的方式显示,这是因为(A)A.在首选项对话框中选中“显示英文字体名称”选项B.在首选项对话框中没有选中“显示亚洲字体选项”C.中文字体本身的名称就是英文方式显示的D.无法确定8、如图所示,参考线发生从上图到下图的变化。
请问下列关于参考线的说法正确的是(BD)A.参考线只有几种可选择的颜色,不能自定义颜色B.参考线可以设置任意的颜色C.参考线的样式有多种,如:直线、虚线、双线……等D.参考线的样式只有两种:直线和虚线9、下列关于暂存盘的描述哪些是正确的?(ABCD)A.如果得到提示,Photoshop不能完成某操作,因为第一个暂存盘已满,这时需要将硬盘中不要的文件删除,以腾出更多的硬盘空间B.默认情况下,Photoshop将启动磁盘作为第一个暂存盘C.Photoshop可以设定4个暂存盘,并且对暂存盘可分配的大小没有任何限制D.暂存盘和虚拟内存相似,它们之间的主要区别在于暂存盘完全受Photoshop而不受操作系统的控制E.默认情况下,Photoshop在每次启动的时候随机选择一个硬盘作为第一个暂存盘10、下列哪些图像颜色模式是通过“新建”文件对话框无法实现的?(BC)A.Lab模式B.多通道模式C.索引色模式D.位图模式11、如图所示,将左图通过“编辑〉变换〉缩放”命令进行缩放,得到右图的结果,请问在Photoshop中应该运用哪种插值运算方法?(D)A.两次立方(较好)B.两次立方(较锐利)C.两次线性D.邻近(较快)12、如图所示,关于红色框内的坐标数值单位的设定方法,下列描述正确的是(BCD)A.只能在新建文件时设定B.单击红色框内“十”字右下角的小三角按钮,可弹出标尺单位菜单进行设定C.单击信息调板右上角的小三角按钮,在弹出菜单中选择调板选项,在弹出的信息调板选项对话框中设定鼠标坐标的标尺单位D.当图像显示标尺后,在标尺上单击鼠标右键(Windows操作系统)/按住Ctrl键单击鼠标(Mac OS X操作系统),可弹出标尺单位菜单进行设定13、如图所示,在导航器调板中,要切换成放大工具放大图像,应使用下列哪个快捷键辅助?(B A.ShiftB.Ctrl(Windows操作系统)/Command(Mac OS X操作系统)C.Alt(Windows操作系统)/Option(Mac OS X操作系统)D.字母“Z”14、如图所示,下列关于“图层调板选项”对话框说法正确的是(ABD)A.图层调板选项可以用来调整图层缩览图的大小B.关闭缩览图可以提高性能和节省显示器空间C.图层调板选项可以用来调整图层、通道和路径缩览图的大小D.当选择“无”选项时,图层缩览图以画笔图标显示15、如图所示,图中“公鸡”图层中的背景使用魔棒工具选择后进行删除,得到下图效果,则下列说法不正确的是(C)A.在使用魔棒工具时,容差值越小,选择的选区越精确B.容差值越大,所选择的选区越大,当容差值为255时,选区为全选C.容差值不能为0D.在使用魔棒工具选择选区时,容差值的大小应根据不同的图像来设定16、如图所示,在图像合成时,使用了羽化选区的方法,下列关于羽化说法正确的是(ACD)A.可以使用套索工具的工具选项栏中的羽化选项或菜单中的羽化命令制作羽化的选区B.可以先使用套索工具确定选区,再在套索工具的选项栏中输入羽化值C.使用菜单中的羽化命令必须在选区制作完成后再进行设定D.羽化后的选区有可能是不可见的17、如图所示,当椭圆选区进行填充后,放大显示边缘时有明显的锯齿效果,这是因为(A)A.在建立选区前没有在椭圆工具的工具选项栏中选择“消除锯齿”选项B.在建立选区后没有在椭圆工具的工具选项栏中选择“消除锯齿”选项C.在建立选区前没有在椭圆工具的工具选项栏中选择“羽化”选项D.在建立选区后没有在椭圆工具的工具选项栏中选择“羽化”选项18、如图所示,在图中原稿的尺寸为8c m×5cm,若要扫描后使用1751pi印刷成尺寸为16cm×10cm的规格,请问在扫描时应选择多大的扫描分辨率进行扫描?(C)A.175像素/英寸B.350像素/英寸C.700像素/英寸D.1400像素/英寸19、图所示为图像以及其直方图的显示,请问该图像属于哪一类色调的图像?(B)A.暗调B.中间调C.亮调20、如图所示,使用Adobe Bridge的“批量命名”命令对图像进行批重命名,要使左图的文件名批重命名成右图所示文件名,则文件命名规则应使用(D)A.“Pic”+“2位数序号”+“jpg”B.“Pic-”+“01”+“扩展名(小写)”C.“pic”+“0.1”D.“Pic-”+“2位数序号”21、如图所示,图中带有形状图层的图像文件包含矢量的信息,为了保留这些矢量信息,并可以在下一次在Photoshop中修改,应使用以下何种文件格式进行存储?(AB)A.TIFE(*.TIF,*.TIFE)B.Photoshop PDF(*.PDF,*.PDP)C.Photoshop EPS(*.EPS)D.Illustator(*.AI)22、如图所示,在“存储为”对话框中,如果使“使用校样设置”成为可选择项,应将文件存储为以下何种文件格式?(AC)A.*.PDFB.*.BMPC.*.TIFFD.*.EPS23、如图所示,在首选项的文件处理对话框中,下列说法正确的是(BD)A.在存储图像时,为了加速浏览速度,应在“图像预览”的弹出选项栏中选择“小缩略图”B.psb文件格式能够支持宽度或高度最大为300,000像素的文档C.“启用Version Cue工作组文件管理”选项选中后,需要重新启动Photoshop才可以生效D.“近期文件列表包含”是用来设定在“最近打开文件”子菜单中可调用的文件集24、下列关于导入PDF图像说法不正确的是(ACD)A.导入图像将以屏幕分辨率72ppi在Photoshop中打开B.被导入的PDF图像进行编辑后,执行存储命令,PDF文件中的图像可以自动更新C.通过“导入>PDF图像”,只能导入PDF中的位图图像D.导入PDF图像时,将弹出“栅格花通用PDF格式”对话框,可对图像的分辨率进行设定25、下列关于将“导出路径到Illustrator”中说法正确的是(BCD)A.可以任意选择一个或者多个路径进行导出B.矢量蒙版也可以进行导出路径到IllustratorC.图层的矢量蒙版在未选择的状态下,是无法导出的D.导出路径到Illustrator命令中,只能导出路径调板中所包含的路径26、如图所示,使用磁性套索工具在选择的过程中,在不中断选择的情况下要将磁性套索工具快速变成多边形套索工具的方法是(A)A.按住Alt键,单击鼠标B.按住Alt键,双击鼠标C.按住Shift键,单击鼠标D.按住Shift键,双击鼠标27、如图所示,左上图使用魔棒工具对图像中绿色条进行选择,选择结果如图所示,请问在使用魔棒工具时,应该将下列哪个选项前的对勾取消?(C)A.消除锯齿B.容差C.连续的D.用于所有图层28、如图所示,将左上图中的路径转换成右下图的选区,下列操作方法描述正确的是(ABC)A.使用路径选择工具,在图像的路径上单击鼠标右键(Windows操作系统)/按住Ctrl键单击鼠标(Mac OS X操作系统),在弹出的菜单中选择“建立选区”B.按住Ctrl(Windows操作系统)/Command(Mac OS X操作系统)键,单击路径调板中的当前工作路径C.单击路径调板中的“将路径作为选区载入”按钮D.按住Shift键,单击路径调板中的“将路径作为选区载入”按钮,将弹出建立选区对话框,对创建的新选区做设定29、如图所示,使用魔术棒工具对图像进行选择,在下图显示的选区增加过程中,应该使用图中ABCD哪个按钮辅助选择?(B)30、如图所示,左上图的选区是由魔棒工具选择产生的,要将选区内的漏选部分快速消除,得到右下图的结果,应使用下列哪个命令?(C)A.收缩B.边界C.平滑D.扩展31、如图所示,右上图中为执行“色彩范围”命令的窗口,在“选区预览”选项中,选择何种预览方式可以得到左下图的预览效果?(D)A.灰度B.白色杂边C.黑色杂边D.快速蒙版32、如图所示,A为原图,BCD所对应的哪一个图为执行抽出滤镜后的结果?(B)A.如图B所示——得到轮廓选区B.如图C所示——得到被选择的图形和透明背景C.如图D所示——得到被选择的图形和背景色(比如白色)D.以上都不是,得到新的Alpha通道33、如图所示,将左图中选区存储为右图的通道,请问下列哪些说法是正确的?(AC)A.执行“选择〉存储选区”命令,在弹出的存储选区对话框中创建新通道,并命名为“queen”B.执行“选择〉存储选区”命令,在弹出的存储选区对话框中创建新文档,并命名为“queen”C.按住Alt键,在通道调板中单击“将选区存储为通道”按钮,在弹出的“新通道”对话框中将名称命名为“queen”,单击“确定”按钮D.按住Ctrl键,在通道调板中单击“将选区存储为通道”按钮,在弹出的“新通道”对话框中将名称命名为“queen”,单击“确定”按钮34、如图所示,左图为快速蒙版效果,如果使快速蒙版效果显示如中图所示,必须更改下图中的哪个选项?(AB)A.更改“色彩指示”选项B.更改“颜色”选项C.更改“不透明度”选项35、如图所示,通过复制通道的方法给左图的猫创建选区,将小猫拷贝粘贴到另外的背景中得到右图所示效果,请问应最好复制通道调板中哪个通道来创建选区?(B)A.“RGB”通道B.“红”通道C.“绿”通道D.“蓝”通道36、如图所示,左上图中背景土层要转换成右下图中的普通图层,下列方法描述正确的是(BC)A.将图层调板中背景图层的缩略图拖到图层调板中的“创建新图层”按钮上即可B.执行“图层〉新建〉背景图层”命令,可弹出对话框,确定即可C.双击背景图层的缩略图,可弹出对话框,确定即可D.将图层调板中背景图层的缩略图拖到图层调板中的“删除图层”按钮上即可37、下面对图层组描述正确的是(ABD)A.在图层调板底部中单击“创建新组”按钮可以新建一个图层组B.可以将所有链接图层一次性拖放到一个新的图层组中C.按住Command(Mac OS X操作系统)/Ctrl(Windows操作系统)键的同时用鼠标单据图层调板底部“创建新组”按钮,可以弹出“图层组属性”对话框D.在图层组内可以对图层进行删除和复制38、如图所示,对上图中名称为“画”的图层进行锁定,将图层中的部分颜色进行完全替换得到下图所示效果,请问应锁定哪个按钮可进行此操作?(A)A.锁定透明像素B.锁定图像像素C.锁定位置D.锁定全部39、如图所示,左上图的标志和DDC Media对应图层调板中的“Logo”和“Type”图层,将这两个图层的“填充”由100%改为0%,得到右下图所示结果,请问下列关于“填充”与“不透明度”的说法正确的是(ABD)A.当图层中没有图层模式时,使用“填充”和“不透明度”的效果是一致的B.当图层中图层样式使用了“不透明度”为100%的“颜色叠加”后,改变图层的“填充”的数值,图层不发生变化C.当图层中图层样式使用了“不透明度”为100%的“颜色叠加”后,改变图层的“不透明度”的数值,图层不发生变化D.要改变图层中图层样式的整体透明度效果,应使用图层调板中的“不透明度”调整40、如图,上图中“Logo”图层的图层混合模式为正常,要使图像达到下图所示的效果,应将图层混合模式改为(D)A.叠加B.颜色C.颜色加深D.亮光41、如图,在左上图中不同的图像分别在3个不同的链接图层上,执行右上角哪些按钮的命令后,可以得到右图所示结果?(AB)42、如图,左上图经过改变图层的排列顺序得到右图所示效果,请问下列有关图层排列的哪些描述是正确的?(ACD)A.图层在排列过程中,只能一次调整一个图层的顺序B.图层在排列过程中,链接的图层可以同时进行顺序的调整C.在执行“图层>排列”命令时,所需要排列顺序的图层前面必须有画笔图标显示D.在图层调板中调整图层的排列顺序,所需要排列顺序的图层前面不必有画笔图标显示43、如图,左上图“white”为文字图层,要执行栅格化操作后通过滤镜处理成右图所示效果,下列关于将文字图层栅格化的说法正确的是(ABC)A.对文字图层执行滤镜命令时,将自动弹出警告对话框,选择“确定”按钮,文字图层将被栅格化并执行滤镜命令B.使用画笔工具单击图像中的文字图层,将自动弹出警告对话框,选择“确定”按钮,文字图层被栅格化C.执行“图层>栅格化〉文字”命令D.在图层调板中按住Alt键,双击文字图层,将弹出警告对话框,选择“确定”按钮,文字图层被栅格化44、如图,在左图中文字图层中的文字边缘有一些杂边,要将杂边修除成右图所示,请问使用下列哪个命令最适合?(A)A.图层〉修边〉去边B.图层〉修边〉移去黑色杂边C.图层〉修边〉移去白色杂边45、如图,图中的形状图层可以通过以下哪些方法建立?(ABC)A.通过“形状图层”选项建立形状图层B.路径执行“图层〉新填充图层〉纯色”命令建立形状图层C.将文字图层执行“图层〉文字〉转换为形状”命令创建形状图层D.将图层执行“图层〉新图层〉转换为形状”命令创建形状图层46、如图,左图为图案填充图层,右图是将图案填充图层的图案放大200%后的效果,下列关于图案填充图层说法正确的是(AD)A.若要改变“图案填充图层”中图案的位置,只需用移动工具直接移动填充图层即可(前提是在“图案填充图层”对话框中“与图层链接”选项被选中B.若要改变“图案填充图层”的图案大小,可使用Ctrl(Windows操作系统)/Command(Mac OS X操作系统)+T 自由变换命令直接缩放C.“图案填充图层”的图案一旦被填充后,无法更换D.在图层调板中的“图案填充图层”的图层缩览图上双击鼠标,可弹出图案填充对话框,在对话框里即可改变图案的大小47、如图,左图的“LOGO”图层添加图层样式后,得到右图所示效果,请问右图中的效果一定添加了以下哪些图层样式?(ABD)A.外发光B.斜面和浮雕C.颜色叠加D.渐变叠加48、如图,左图的是通过图层样式建立的效果,将图层样式进行“缩放效果”得到右图所示效果,下列描述操作图层样式“缩放效果”方法正确的是(BD)A.执行“图层〉图像大小”命令,在弹出的“图像大小”对话框中,选择“缩放样式”选项B.在图层跳板中该图层“f”图标上单击右键,在弹出的菜单中选择“缩放效果”命令C.双击图层调板中的“f”图标,弹出“图层样式”对话框,在“混合选项”拖动“缩放效果”滑动各条进行缩放效果设置D.选择图层,执行“图层>图层样式〉缩放效果”命令49、如图,图中“花”图层是“蓝色绒布”和“绿色水墨”图层的剪贴蒙版,下列有关剪贴蒙版的说法正确的是(ABD)A.关闭“蓝色绒布”图层的显示,不影响图像的显示效果(将和左图一样,不发生变化)B.选中“蓝色绒布”图层,执行“图层〉释放剪贴蒙版”命令,“绿色水墨”图层的剪贴蒙版将解除C.创建剪贴蒙版后的图层,不能添加图层样式D.隐藏“花”图层,形成剪贴蒙版效果的3个图层将全部隐藏50、如图,左图为图层复合调板中“图层复合1”的状态,右图为“图层复合2”的状态,请问下列描述中哪些是正确的?(AD)A.在“图层复合2”中由于图层图像做了90°的旋转,所以不能回复到与“图层复合1”一模一样的状态B.将图层复合选项中的“位置”选项勾选,就能回复到与“图层复合1”相同的状态C.如果在“图层复合2”中图层图像做了90°的旋转,“图层复合1”就会出现黄色的警告图标D.如果在“图层复合2”中图层图像做了90°的旋转,“图层复合1”不会出现的警告图标51、下列关于颜色通道的说法正确的是(ACD)A.单独显示青色通道时,通道呈灰度状态B.通道是不能进行单独调整的C.一个通道只代表一种颜色的明暗变化D.黄色通道是由图像中所有黄色像素点的信息组成的52、如图,左上图为CMYK图像,需要将图像转换成如右图所示的双色调图像,下列描述不正确的是(ACD)A.CMYK图像执行“图像>模式〉双色调”命令,将图像转换成双色调图像B.CMYK图像要转换成灰度图像后,才能执行“图像>模式>双色调”命令C.执行“图层>模式>双色调”命令后,在弹出的双色调对话框中可以选择1~4种颜色的油墨进行双色调的混合D.双色调图像有两个通道53、如图,要将上图中的选区存储为下图所示的Alpha通道,则下列描述正确的是(AC)A.执行“选择>存储选区”命令,将选区存储为新通道B.单击通道调板下方的“将选区存储为通道”按钮,在弹出的“新通道”对话框中输入所要建立新通道的名称C.按住Alt键,单击通道调板下方的“将选区存储为通道”按钮,在弹出的“新通道”对话框中输入所要建立新通道的名称D.单击通道调板下方的“新通道”按钮,在弹出的“新通道”对话框中输入所要建立新通道的名称54、如图,在上图的通道调板中,如何将“葡萄粒”的Alpha通道转换为下图所示的选区,下列说法正确的是(ABD)A.选择“葡萄粒”通道,单击通道调板中“将通道作为选区载入”按钮B.按住Ctrl(Windows操作系统)/Command(Mac OS X操作系统)键,使用鼠标左键单击“葡萄粒”通道C.按住Alt键,使用鼠标左键单击“葡萄粒”通道D.执行“选择〉载入选区”命令,在弹出的载入选区对话框中选择“葡萄粒”通道55、如图,上图图像为灰度图像,添加文字和专色后得到下图所示效果,请问下列有关添加专色的说法正确的是哪些?(AB)A.建立选区后,单击通道调板右上角的小三角,在弹出的菜单中选择“新专色通道”B.建立Alpha通道后,使用鼠标双击Alpha通道,弹出Alpha通道对话框,将色彩指示改为专色通道C.选择Alpha通道,单击通道调板右上角的小三角,在弹出的菜单中选择“新专色通道”D.专色一旦建立,就无法更换,只能删除56、如图,将左图中的红色通道和蓝色通道进行对调,得到右图的特殊效果,则下列关于实现通道对调的方法正确的是(C)A.在通道调板中,双击通道名称,弹出通道选项对话框,将通道名称更改即可B.在通道调板中,使用鼠标将“红”通道拖曳移至最下方,将“蓝”通道移至最上方即可C.先使用“分离通道”命令将图像的通道进行分离,再执行“合并通道”命令,在“合并RGB通道”对话框中指定通道对调D.通道之间无法对调57、如图,由左上图中的选区状态切换到右图的快速蒙版状态,应使用键盘上的哪个字母键(软件默认状态下)?(C)A.字母“F”B.字母“B”C.字母“Q”D.字母“R”58、如图,左上图是整个图像(没有选区)在快速蒙版状态下的显示,只改变快速蒙版的某些选项,出现如右图所示效果。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
310-025Leading the way in IT testing and certification tools, Question No: 1Given:1. public class test (2. public static void main (String args[]) {3. int i = 0xFFFFFFF1;4. int j = ~i;5.6. }7. )What is the decimal value of j at line 5?A. 0B. 1C. 14D. –15E. An error at line 3 causes compilation to fail.F. An error at line 4 causes compilation to fail.Answer: DQuestion No: 2Given:Integer i = new Integer (42);Long 1 = new Long (42);Double d = new Double (42.0);Which two expressions evaluate to True? (Choose Two)A. (i ==1)B. (i == d)C. (d == 1)D. (i.equals (d))E. (d.equals (i))F. (i.equals (42))Answer: D, EQuestion No: 3Exhibit :1. public class test (2. private static int j = 0;3.4. private static boolean methodB(int k) (5. j += k;6. return true;6. )7.8. public static void methodA(int i) {9. boolean b:10. b = i < 10 | methodB (4);11. b = i < 10 || methodB (8);12. )13.14. public static void main (String args[] } (15. methodA (0);16. system.out.printIn(j);17. )18. )What is the result?A. The program prints “0”B. The program prints “4”C. The program prints “8”D. The program prints “12”E. The code does not complete.Answer: BQuestion No: 4Given1. Public class test (2. Public static void main (String args[]) (3. System.out.printIn (6 ^ 3);4. )5. )What is the output?Answer: 5Question No: 5Given:1. public class Foo {2. public static void main (String [] args) {3. St ringBuffer a = new StringBuffer (“A”);4. StringBuffer b = new StringBuffer (“B”);5. operate (a,b);6. system.out.printIn{a + “,” +b};7. )8. static void operate (StringBuffer x, StringBuffer y) {9. x.append {y};10. y = x;11. )12. }What is the result?A. The code compiles and prints “A,B”.B. The code compiles and prints “A,A”.C. The code compiles and prints “B,B”.D. The code compiles and prints “AB,B”.E. The code compiles and prints “AB,AB”.F. The code does not compile because “+” cannot be overloaded for StringBuffer. Answer: DQuestion No: 6Exhibit:1. Public class test (2. Public static void stringReplace (String text) (3. Text = text.replace (…j' , …i');4. )5.6. public static void bufferReplace (StringBuffer text) (7. text = text.append (“C”)8. )9.10. public static void main (String args[]} (11. String textString = new String (“java”);12. StringBuffer text BufferString = new StringBuffer (“java”);13.14. stringReplace (textString);15. BufferReplace (textBuffer);16.17. System.out.printIn (textString + textBuffer);18. }19. )What is the output?Answer: javajavaCQuestion No: 7Exhibit:1. public class test {2. public static void add3 (Integer i) }3. int val = i.intValue ( );4. val += 3;5. i = new Integer (val);6. }7.8. public static void main (String args [ ] ) {9. Integer i = new Integer (0);10. add3 (i);11. system.out.printIn (i.intValue ( ) );12. }13. )What is the result?A. Compilation will fail.B. The prog ram prints “0”.C. The program prints “3”.D. Compilation will succeed but an exception will be thrown at line 3. Answer: BQuestion No: 8Given:1. public class ConstOver {2. public ConstOver (int x, int y, int z) {3. }4. }Which two overload the ConstOver constructor? (Choose Two)A. ConstOver ( ) { }B. Protected int ConstOver ( ) { }C. Private ConstOver (int z, int y, byte x) { }D. Public Object ConstOver (int x, int y, int z) { }E. Public void ConstOver (byte x, byte y, byte z) { }Answer: A, CQuestion No: 9Given:1. public class MethodOver {2. public void setVar (int a, int b, float c) {3. }4. }Which two overload the setV ar method? (Choose Two)A. Private void setVar (int a, float c, int b) { }B. Protected void setVar (int a, int b, float c) { }C. Public int setVar (int a, float c, int b) (return a;)D. Public int setVar (int a, int b, float c) (return a;)E. Protected float setVar (int a, int b, float c) (return c;)Answer: A, CQuestion No: 10Given:1. class BaseClass {2. Private float x = 1.0f ;3. protected float getV ar ( ) ( return x;)4. }5. class Subclass extends BaseClass (6. private float x = 2.0f;7. //insert code here8. )Which two are valid examples of method overriding? (Choose Two)A. Float getVar ( ) { return x;}B. Public float getVar ( ) { return x;}C. Float double getVar ( ) { return x;}D. Public float getVar ( ) { return x;}E. Public float getVar (float f ) { return f;}Answer: B, DQuestion No: 11Which two demonstra te an “is a” relationship? (Choose Two)A. public interface Person { }public class Employee extends Person { }B. public interface Shape { }public class Employee extends Shape { }C. public interface Color { }public class Employee extends Color { }D. public class Species { }public class Animal (private Species species;)E. interface Component { }Class Container implements Component (Private Component[ ] children;)Answer: D, EQuestion No: 12Which statement is true?A. An anonymous inner class may be declared as final.B. An anonymous inner class can be declared as private.C. An anonymous inner class can implement multiple interfaces.D. An anonymous inner class can access final variables in any enclosing scope.E. Construction of an instance of a static inner class requires an instance of the enclosing outer class.Answer: DQuestion No 13Given:1. package foo;2.3. public class Outer (4. public static class Inner (5. )6. )Which statement is true?A. An instance of the Inner class can be constructed with “new Outer.Inner ()”B. An instance of the inner class cannot be constructed outside of package foo.C. An instance of the inner class can only be constructed from within the outer class.D. From within the pac kage bar, an instance of the inner class can be constructed with “new inner()”Answer: AQuestion No 14Exhibit:1. public class enclosingone (2. public class insideone{}3. )4. public class inertest(5. public static void main (string[]args)(6. enclosingone eo= new enclosingone ();7. //insert code here8. )9. )Which statement at line 7 constructs an instance of the inner class?A. InsideOnew ei= eo.new InsideOn();B. Eo.InsideOne ei = eo.new InsideOne();C. InsideOne ei = EnclosingOne.new InsideOne();D. EnclosingOne.InsideOne ei = eo.new InsideOne();Answer: DQuestion No 15Exhibit:1. interface foo {2. int k = 0;3. ]4.5. public class test implements Foo (6. public static void main(String args[]) (7. int i;8. Test test = new test ();9. i= test.k;10.i= Test.k;11.i= Foo.k;12.)13.)14.What is the result?A. Compilation succeeds.B. An error at line 2 causes compilation to fail.C. An error at line 9 causes compilation to fail.D. An error at line 10 causes compilation to fail.E. An error at line 11 causes compilation to fail.Answer: AQuestion No 16Given:1. //point X2. public class foo (3. public static void main (String[]args) throws Exception {4. printWriter out = new PrintWriter (new5. java.io.outputStreamWriter (System.out), true;6. out.printIn(“Hello”);7. }8. )Which statement at PointX on line 1 allows this code to compile and run?A. Import java.io.PrintWriter;B. Include java.io.PrintWriter;C. Import java.io.OutputStreamWriter;D. Include java.io.OutputStreamWriter;E. No statement is needed.Answer: AQuestion No 17Which two statements are reserved words in Java? (Choose Two)A. RunB. ImportC. DefaultD. ImplementAnswer: B, CQuestion No 18Which three are valid declarations of a float? (Choose Three)A. Float foo = -1;B. Float foo = 1.0;C. Float foo = 42e1;D. Float foo = 2.02f;E. Float foo = 3.03d;F. Float foo = 0x0123;Answer: A, D, F。