1.
The programs that computer executes are called
A. 
B. 
C. 
Integrated development environment
D. 
2.
The ENIAC computer was build from which components:
A. 
B. 
C. 
D. 
3.
The Java code on the Internet and that are run by Web browsers are called:
A. 
B. 
C. 
D. 
4.
The free Java modules that perform various specific tasks and that make Java arich and portable language are called:
A. 
B. 
C. 
D. 
5.
Which one of the following statements is true about a Java compiler?
A. 
It translates the object code into the source code.
B. 
It translates the library code into the virtual machine code.
C. 
It translates the source code into the virtual machine code.
D. 
It translates the virtual machine code into the source code.
6.
Which one of the following programs can execute Java class files?
A. 
B. 
C. 
D. 
7.
Is there anything wrong with this code?System.out.print("3 + 3 =")System.out.println(3 + 3);
A. 
B. 
C. 
D. 
8.
Java can be used to develop rich applications for the Web that are called
A. 
B. 
C. 
D. 
9.
A major difference between C++ and Java is that:
A. 
C++ is a high-level, while Java is a low-level language
B. 
C++ is designed for consumers, while Java is designed for commerce
C. 
C++ is object-oriented, while Java is not
D. 
C++ is not portable, while Java is portable
10.
An example of a Java integrated development environment is:
A. 
B. 
C. 
D. 
11.
A Java class with the name Printer has to be saved using the source file name:
A. 
B. 
C. 
D. 
12.
This statement starts the declaration of a class in Java:
A. 
Public static void main(String[] args)
B. 
C. 
System.out.println("Hello, World!");
D. 
13.
This Java statement prints a blank line:
A. 
Public static void main(String[] args)
B. 
C. 
D. 
14.
Which Java statement does not contain an error?
A. 
B. 
C. 
D. 
15.
In order to run Java programs on a computer, the computer needs to have softwarecalled a(n):
A. 
B. 
C. 
D. 
16.
The Java statement "public static void main(String[] args)" declares a :
A. 
B. 
C. 
D. 
17.
What is the output of the following code snippet?System.out.print("Hello");System.out.println("Good Day!");
A. 
B. 
C. 
D. 
No output due to compilation errors
18.
What is the purpose of the following algorithm?num = 0Repeat the following steps for 100 timesinput var1if var1 > numnum = var1print num
A. 
To find the highest among 100 numbers
B. 
To print out the 100 numbers
C. 
To find the smallest among 100 numbers
D. 
To search for a particular number among 100 numbers
19.
Consider the following pseudocode. What does it produce?Create a list of consecutive integers from two to n: (2, 3, 4, ..., n).Initially, let p equal 2.Repeat following steps until p2 is greater than n.Strike from the list all multiples of p less than or equal to n.Find the first number remaining on the list greater than p; replace p with thisnumber.
A. 
All even numbers from 2 to n
B. 
All Fibonacci numbers from 2 to n
C. 
All prime numbers from 2 to n
D. 
All factorial numbers from 2 to n
20.
What operation is least efficient in an ArrayList?
A. 
Add element to the middle of the list
B. 
C. 
D. 
21.
Which data structure would best be used for keeping track of bank customerswaiting for a teller?
A. 
B. 
C. 
D. 
22.
What must be included in a LinkedList class node?I a reference to the next nodeII a reference to the previous nodeIII a data element
A. 
B. 
C. 
D. 
23.
Assuming that staff is a LinkedList object, what is the content and iteratorposition in the staff object?public static void main(String[] args){LinkedList staff = new LinkedList();staff.addLast("Diana");staff.addLast("Tom");staff.addLast("Harry");staff.addLast("Romeo");// | in the comments indicates the iterator positionListIterator iterator = staff.listIterator(); // |DTHRiterator.next();iterator.next();iterator.add("Juliet");iterator.add("Nina");iterator.previous();iterator.remove();…}
A. 
B. 
C. 
D. 
24.
Which method in the ListIterator class cannot be called twice in a row?
A. 
B. 
C. 
D. 
25.
Why is it important to understand the underlying implementations of data structuretypes?(e.g. HashSet, TreeSet, ArrayList, LinkedList, etc.)
A. 
It helps you choose a better coding implementation
B. 
It helps you choose a data structure with best efficiency in all operations
C. 
It helps you choose a data structure with best efficiency in operations you need
most
D. 
Nothing, because we do not know about implementation details
26.
What operation is least efficient in a LinkedList?
A. 
B. 
C. 
D. 
27.
In a linked list data structure, when does the reference to the first node need to beupdated?I inserting into an empty listII deleting from a list with one nodeIII deleting an inner node
A. 
B. 
C. 
D. 
28.
What is the result of this code?Queue q = new LinkedList();q.add("C");q.add("B");q.add("A");while (q.size() > 0) { System.out.print(q.remove() + " "); }
A. 
Q will contain a single element, "A"
B. 
C. 
D. 
The code does not compile because q is not a LinkedList type
29.
Which operations from the list data structure could be used to implement the addand remove operations of a FIFO queue structure?I addLastII add FirstIII removeFirst
A. 
B. 
C. 
D. 
30.
Suppose you push integer elements 1,2,3,4 on the stack in that order, then pop offthe stack and add them to a queue, and repeat that three more times, shifting he elementsfrom the queue to the stack each time. In what order will you remove the elements from thequeue on the fourth time?
A. 
B. 
C. 
D. 
31.
A(n) ____________________ is a collection of items with "last in first out" retrieval.
A. 
B. 
C. 
D. 
32.
____________________ store items in a first in, first out or FIFO fashion.
A. 
B. 
C. 
D. 
33.
The Stack peek operation is not considered a primitive operation because it can bereplicated by a sequence of other Stack operations. Choose the correct sequence.
A. 
B. 
C. 
D. 
34.
What happens when we try to add an element to a Set in which the element isalready present?
A. 
It is added after its duplicate
B. 
Is replaces the duplicate
C. 
D. 
It is added anywhere convenient
35.
Which Java code is not correct?I Set cats = new HashSet();II HashSet cats = new HashSet();III HashSet cats = new TreeSet();
A. 
B. 
C. 
D. 
36.
HashMap and TreeMap classes both implement the Map interface. What makesthem different?I they use different underlying data structuresII HashMap does not implement all Map methodsIII HashMap can only handle a fixed number of key, value pairs
A. 
B. 
C. 
D. 
37.
Which code is correct based upon the object declaration below?Map myLabels = new HashMap();
A. 
MyLabels.put(new JLabel("Hi"), "John");
B. 
MyLabels.put("John", new JLabel ("Hi"));
C. 
D. 
MyLabels.remove(new JLabel ("Hi");
38.
What does the equals method, inherited from the Object class, actually test for?
A. 
If the objects have the same name
B. 
If the objects are stored in the same location
C. 
If all corresponding fields have the same value
D. 
If at least one corresponding field has the same value
39.
Which hash table method will make use of the equals method?I hashcodeII mapIII contains
A. 
B. 
C. 
D. 
40.
If you override the equals method but not the hashCode method, what is the likelyresult?
A. 
Some objects will be impossible to find
B. 
The number of collisions will be high
C. 
The get method will run at O(n) complexity
D. 
The get method will run at O(1) complexity
41.
Suppose we create an Iterator to a 10-element LinkedList. After calling the nextmethod, we call the remove method twice. What will be the result?I an IllegalStateException is thrownII first two linked list elements are removedIII first linked list element is removed
A. 
B. 
C. 
D. 
42.
If we insert into an empty binary search tree the following sequence of nodes withthe specified keys, what will be the result?Keys: 12 , 7, 25, 6, 9, 13, 44
A. 
The tree will resemble a list
B. 
Node with key = 7 will not have any children
C. 
The root will have key = 12
D. 
The root will have key = 6
43.
When designing a hierarchy of classes, features and behaviors that are common toall classes are placed in ____.
A. 
Every class in the hierarchy
B. 
C. 
D.