Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

ecogt

.docx
Скачиваний:
17
Добавлен:
25.02.2016
Размер:
32.97 Кб
Скачать

A binary association is said to exist between two classes when an object of one class requires an object of the other class

A design pattern is typically used to describe a practical solution to a common design problem

A design pattern is typically used to describe a practical solution to a common design problem

A difference between the methods print and println of the class java.io.PrintWriter is that println appends a new line to the end of its output, but print does not

A difference between the methods print and println of the class java.io.PrintWriter is that println appends a new line to the end of its output, but print does not

A Java array that contains n components will be indexed from _____ through _____.0, n-1

A relationship that exists between two specific instances of an object is known as a(n) link

A stack trace is a sequence of method calls

Java identifier may begin with all but which of the following? 0

stack trace is a sequence of method calls

According to Javadoc convention, the first sentence of each Javadoc comment should be a summary sentence of the declared entry

According to the Java code conventions, files longer than _____ lines should be _____. 2000, avoided,

According to the Java code conventions, files that contain Java source code have the suffix _____, and compiled bytecode files have the suffix _____. java, .class

All Java exception classes are derived from the class java.lang.Throwable

All Java exception classes are derived from the class java.lang.Throwable

An object model describes which of the following? I. Attributes of classes;II. Methods of classes;III.Relationships between classesI, II, and III

An object that contains methods that traverse a collection linearly from start to finish is known as a(n) iterator

Classes from which of the following packages are implicitly imported into every Java program? java.lang

Consider the class described by the following diagram: If the class represents an employee and the boss attribute refers to the employee's boss, which of the following statements is (are) true? I. Many employees can have the same boss.II. One employee can have many bosses. I only

Consider the following Java class definitions. (object) I, II, and III

Consider the following Java program fragment. public void drive(Vehicle v) { ... }...drive(obj);The method call drive(obj) is valid if obj is which of the following? I and III only

Consider the following Java program segment String[] str = {"Three","Two","One"}; for (int i = 0; i < str.length; ++i){System.out.println(str[i]+"/"); What will be output upon execution of the program segment? Three/Two/One/

Consider the following Java program segment. int x = 5; int y = 2; System.out.println(x + "1" + y);Which of the following statements is true about the program segment? The output caused by the code will be 512.

Consider the following Java program segment. import java.io.*;public class SomeClass{ public void x() { throw new RuntimeException("Exception from x"); } public void y(){ throw new IOException("Exception from y"); }} Which of the following is true concerning the definitions for the methods x and y? x has a legal definition, but y has an illegal definition.

Consider the following Java program segment. int[] arr;arr = new int[3];arr[2]=19;arr[1]=17;arr[0]=15; int[] arr= {15, 17, 19};

Consider the following Java program segment. Which of the following will be output during execution of the program segment? The line of text "non-default"

Consider the following Java program segment. Which of the following will be output during execution of the program segment? The line of text "non-default

Consider the following Java program segment.PrintWriter fileOut = new PrintWriter( new FileWriter("output.txt"));If the file output.txt already exists, which of the following events will occur when the program segment is executed? The existing contents of output.txt will be erased.

Consider the following Java program segment.Which of the following is true concerning the definitions for the methods x and y? x has a legal definition, but y has an illegal definition

Consider the following line of Java code. int x = 1+7*2; What will be the value of x at the end of execution of the line of code? 15

Consider the following line of Java code. int x = 8/5; What will be the value of x at the end of execution of the line of code? 1

Consider the following method call, where c is an instance of the class java.util.ArrayList. c.size();This method call returns the number of elements in the ArrayList represented by c

Consider the following UML class diagram. According to the diagram, which of the following statements is true? ClassA is composed of one instance of ClassB and one or more instances of ClassC.

Consider the Java program below. public class Arr{ public static void main(String[] args) { int[] a = {1, 2, 3}; int[] a = {1, 2, 3}; Which of the following is true about the result of executing the program The number 2 is printed and a run-time exception terminates execution

Data fields in an interface implicitly have _____ access in Java. public

From within a child class, its parent class is referred to via the keyword super

Given the following code, how many tokens will be output? StringTokenizer st = newStringTokenizer("this is a test");while (st.hasMoreTokens()) { stdOut.println(st.nextToken() );} 4

Given the following code, how many tokens will be output? StringTokenizer st = new StringTokenizer("this is a test");while (st.hasMoreTokens()) { stdOut.println(st.nextToken() );}4

Given the following code, what value will be output by the last statement? StringTokenizer st = new StringTokenizer("this is,a,test of tokens", ",");String s;int count = 0;while st.hasMoreTokens()){ s = st.nextToken(); ++count;}stdOut.println(count);3

How many lines of output will be produced by the following code fragment?for (int i = 0; i < 3; ++i) { 3

If a class contains a constructor, that constructor will be invoked each time an object of that class is instantiated

If the length of a particular array is the value of LIMIT, what is the index of the last item in that array? LIMIT – 1

If the method int sum(int a, int b) is defined in a Java class C, which of the following methods cannot coexist as a different method in class C? int sum(int x, int y)

In a UML class diagram's representation of a class, the top, middle, and lower rectangular compartments respectively describe the _____ of the class. name, attributes, and methods

In Java, all methods in an interface must be _____ and _____. public, abstract

In Java, the default layout manager for a JPanel component is FlowLayout

In Java, what is the signature of the method in the WindowListener interface where code is to be added to end a program when the close button is pressed? void windowClosing (WindowEvent we)

In programming, a loop is generally used to achieve repetition

In which of the following design patterns is a family of algorithms encapsulated into individual but interchangeable classes? strategy

In which of the following design patterns is a family of algorithms encapsulated into individual but interchangeable classes?Strategy

In which of the following ways can items be added to a collection implemented by java.util.ArrayList? Items can be inserted at the beginning of the collection.Items can be inserted between two existing items in the collection.Items can be appended to the end of the collection. I, II, and III

Legal Java statements to initialize an array reference include which of the following? int[] aobj = {0, 1, 2};int[4] aobj = {0, 1, 2};int[] aobj = new int[3]; I and III only

The ActionEvent class and ActionListener interface are available in the _____ package of Java. java.awt.event

The constructor of a class that adheres to the Singleton design pattern must have _____ visibility private

The ListSelectionEvent class and ListSelectionListener interface are available in the _____ package of Java. javax.swing.event

The model part of the Model-View-Controller (MVC) paradigm embodies the abstract domain knowledge of an application

The multiplicity of an association between two classes indicates the number of instances of one class that can be associated with an instance of the other class

The name of a Java source file must be the same as the class it defines, respecting case

The Strategy design pattern is likely to be useful when implementing which of the following: I)An application that offers several alternate sorting algorithms; II)A simple class to store the address of an organization of which only one instance can be instantiated I only

The subclass of an abstract class must be abstract or implement all of the parent's abstract methods

The term wrapper classes refers to a collection of Java classes that "wrap" Java primitive types

The term class variable is a synonym for a static data field

The view part of the Model-View-Controller (MVC) paradigm is the way in which the abstract domain knowledge of an application is presented to the user

UML class diagrams can describe which of the following? I. The internal structure of classes; II. Relationships between classes I and II

View Assessment Result

What is the name of the JDK program that processes Javadoc comments? javadoc

What is the number of regions into which the BorderLayout in Java subdivides a container? 5

What is the right way to handle abnormalities in input on Java? By handling these problems by providing exception handlers

What is the right way to handle abnormalities in input on Java? By handling these problems by providing exception handlers

What is the signature of the method specified in the Java ActionListener interface? void actionPerformed (ActionEvent ae)

What is the signature of the method specified in the Java ListSelectionListener interface? void valueChanged (ListSelectionEvent lse)

What is used to indicate that a method does not return a value? the keyword void

What will be output when the following Java program segment is executed? int x = 5; int y = 2; System.out.println(x + y); 7

When using noun-phrase analysis to model a software system, which of the following should typically be eliminated from the list of potential classes? I. References to the software system itself; II. Nouns that imply roles between objects; III. Synonyms to other nouns in the list I, II, and III

Which is a Java access modifier used to designate that a particular data field will not be inherited by a subclass? private

Which is the Java keyword that denotes the use of an interface?  Implements

Which method must exist in every Java application? main

Which of the following categorizations can be applied to both the data fields and the methods in a Java class? static and non-static

Which of the following characters is not valid in a Java identifier? %

Which of the following is (are) true regarding containers and components in the context of java GUI? A container can be added to a component.A component can be added to a container.A container can be added to another container. II and III only

Which of the following is (are) true regarding event handling in Java? I. When a GUI component is created, the component automatically has the ability to generate events during user interaction. II.Each Listener object must be registered with the specific component object or objects for which the Listener object is to respond. I and II

Which of the following is a Java event that is generated when a JButton component is pressed? ActionEvent

Which of the following is a valid character literal in Java? ';'

Which of the following is a valid literal of type float in Java? 10.5f

Which of the following is the string concatenation operator in Java? +

Which of the following is true about association and aggregation in UML class diagrams? Aggregation is a special form of association.

Which of the following is true of the Singleton design pattern? It ensures that only one instance of a class is created.

Which of the following is true regarding the controller part in the Model-View-Controller (MVC) paradigm? The controller is the automatic mechanism by which the user interface is displayed and by which events are communicated between the model and the view.

Which of the following methods is (are) provided by java.util.Iterator? next, which causes an iterator to return the next item in its iteration;remove, which can remove an item from a collection associated with an iterator I and II

Which of the following parts of an if-else-statement is optional? the else part

Which of the following statements about class variables in Java is not true? All objects have their own copy of the class variable defined in the instantiated class.

Which of the following statements about constructors in Java is true? A class can define more than one constructor

Which of the following statements about Java classes is (are) accurate? A class may have only one parent. Two or more classes may share a parent. I and II

Which of the following statements is (are) true about any abstract method in Java? It contains no definition.It cannot be declared public. I only

Which of the following statements is (are) true about inheritance in Java? A class can extend more than one abstract class. A class can implement more than one interface. II only

Which of the following statements is (are) true about inheritance in Java? A class can extend more than one abstract class. A class can implement more than one interface. II only

Which of the following statements is (are) true about interfaces in Java? Interfaces can extend other interfaces.Interfaces can contain data fields. I and II.

Which of the following statements is (are) true about the use of an asterisk (*) in a Java import statement? I.It does not incur run-time overhead.; II. It can be used to import multiple packages with a single statement.; III. It can be used to import multiple classes with a single statement. I and III only

Which of the following statements is (are) true in Java? All of the methods in an abstract class must be abstract. All of the methods in an interface must be abstract II only

Which of the following statements is (are) true in Java? All of the methods in an abstract class must be abstract.All of the methods in an interface must be abstract II only

Which of the following statements is (are) true in Java? Classes that contain abstract methods must be declared abstract.Classes that contain protected methods must be declared abstract. I only

Which of the following statements is used to exit from a switch statement? break;

Which of the following statements is not true of the class java.util.ArrayList? Once an object is inserted into an instance of ArrayList, it can never be removed.

Which package does not need to be explicitly imported into a Java program? java.lang

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]