What are two parts of ADT?
Private and Public
ArrayList and Vector
Queue and Stack
Parent and Child
Int and float
Which of them has more methods?
Superclass
Subclass
The relationship when one class is a subclass of another is called...
is-a
has-a
The relationship when one class is defined inside the definition of another is called...
is-b
has-b
to-c
Redefinition of method of superclass in a subclass with the same name and number of parameters is...
Override
Overload
Overhead
Upperload
Overbeat
Redefinition of method with the same name but different number of parameters is called...
Overflow
Upperride
Download
If you want to call the constructor of superclass you would use....
super.
super()
this.
this()
constructor()
If you want to call data member of superclass you would use...
method()
If you want to call different constructor of current class you would use...
current.
If there is at least one abstract method in a class, that class is called...
Abstract class
General class
Recursive class
Tired class
Vanish class
If there are no abstract methods in the class we call that class…
Actual class
Super class
Non Abstract class
Funny class
Which part is accessible to user ?
Public
Private
Protected
Social
Interactive
Is it possible to inherit from multiple classes?
Yes
No
Is it possible to implement multiple interfaces?
Every class has _____as a superclass
Object
JAVA
Subject
Main
String
This method returns a string that textually represents an object
toString()
equals()
toText()
toGo()
hashCode()
InstanceOf used to test ...
Whether an object belongs to class or not
Whether object is object or not
Whether object plays football or not
Whether object has parent or not
Whether is the biggest object or not
What is not perfect in this code: ave = sum/count;
Division by zero may occur
Multiplication by 1000000 is impossible in JAVA
Semicolon needed after =
ave should be written as average
It is not JAVA code
Attempt to convert a string that is not numeric to a number faults …
NumberFormatException
ArithmeticException
SDP4IsNotASubjectException
DoNotSpeakException
SadProgrammerException
Attempt to access array element using index less than zero folds
ArrayIndexOutOfBoundsException
GoHomeExpception
InputMismatchException
McDonerException
________ exception is an error normally due to programmer
checked
unchecked
broken
cracked
________ exception is an error normally not due to programmer
hacked
frozen
Which part is not accessible to user ?
private
shifted
controlled
based
public
How to handle exceptions?
try{} catch(){}
try{} batch(){}
poimai{}menya{}esli{}smozhesh{}
fly{}catch(){}
go{}home(){}
Which of the following is not example of visibility in Java ?
protected
package
eclipsed
Returns the reference to the element at position index
get(index)
set(index)
has(index)
goTo(index)
fly(index)
Get the size of ArrayList
size()
size(list)
sizeOf()
length
length(list)
Sets the element on position Index to reference entry
set(index, entry)
setTo(index, entry)
index.set(entry)
entry.set(index)
set.index(entry)
Public xxx(int index){ return theData[index]; } this behavior is similar to which method of ArrayList class?
get
set
size
equals
What is the time complexity of insert(index) method in ArrayList
O(n)
O(1)
O(logn)
O(n^2)
O(m*n)
What is the difference between ArrayList and Vector?
Vector is synchronized, where ArrayList is not
Vector is scalable, where ArrayList is not
Vector is flexible, where ArrayList is not
Vector is resizable, where ArrayList is not
There is no difference
for(int i = 0; i < size; i++) { If(theData[i] == entry) { Return i; } Return -1; } This method is similar to which method of ArrayList
indexOf(entry)
get(entry)
set(entry)
Indicate constant time complexity in terms of Big-O notation
O(const)
The collection of abstract methods is called ...
Interface
Class
Method
Function
Indicate logarithm time complexity in terms of big-O notation?
O(done)
Indicate linear time complexity in terms of big-O notation?
O(n^3)
O(loglogn)
Indicate exponential time complexity in terms of big-O notation?
O(2^n)
O(n^4)
Find the slowest time
O(n!)
O(100)
What is the time complexity of ArrayList remove(index) method
O(n * n)
What is the time complexity of adding an item in front of a LinkedList
O(nlogn)
What is the time complexity of adding element in the beginning of ArrayList
Which method searches for target and returns its position in LinkedList?
indexOf(target)
get(target)
set(target)
equal(target)
Indicate polynomial time complexity
O(n^const) (const = 2,3…)
How to remove item from LinkedList?
Change Link of previous item to next item of item to be removed
Change Link of next item to previous item of item to be removed
Change Link of removing item to next
Change Link of removing item to previous
Go home and cry
What is attribute of CircularList
Next of last item referencing to the first item
Next of first item referencing to the last item
Prev of last item referencing to the last item
Next of best item referencing to the worst item
I need to go home and prepare this
Which of the following in Java is very similar to “contract” ?
Interface implementation
Class inheritance
Method overloading
Class overriding
List iterator and iterator is the same thing in JAVA
Is it possible to traverse containing of a list this way? for(int nextInt : aList) {… }
May be
I don't know
Show the method which exists in a DoubleLinkedList and not exist in a SingleLinkedList
constructor
next()
hasNext()
previous()
hasBefore()
What relationship class Node and LinkedList have?
Is-b
They are couple
Which of them is NOT an example of Data Structure ?
Breadth First Search
ArrayList
Graph
Priority Queue
Set
Which of them is NOT feature of collection interface ?
List
Queue
Vector
This returns TRUE if the collection contains object
contains(obj)
IndexOf(obj)
IndexF(obj)
find(obj)
goTo(obj)
Elements of a List are accessed by means of an
index
switch
position
loop
book
A list can ___ or ___ as items(elements) are added or removed
grow, shrink
flow, shrink
increase, grow
decrease, think
fly, sit
OOP stands for?
Object oriented programming
Obstacle oriented programming
Object oriented playing
Omar oriented programming
The Collection is a _____ of a List ?
superinterface
parent
interface
father
node
Which method returns an object at the top of a Stack in JAVA?
pop()
peek()
front()
poll()
top()
Which method adds an item on the top of a Stack in JAVA?
push()
add()
bush()
First in last out structure is ...
Stack
Tree
Which structure is widely used in finding palindrome?
Map
Which structure is widely used to calculate the value of postfix expression?
Calculate value of “4 7 * 20-“
8
1
136
144
3
Ability of object of one class to act like it is an object of another class
Polymorphism
Encapsulation
Inheritance
Java code
SLOC(Source Line Of Code)
What does method empty return for empty stack?
True
False
Nothing
Empty
Hello
Waiting line of people is similar to which data structure?
LinkedList
If we call remove() function for the queue, which item will be removed
first
last
middle
second
third
Which function return first added item in the queue?
first()
element()
goBack()
giveMeFirst()
Which function is used to add new item in the queue?
offer()
suffer()
remove()
First-in first-out data structure ...