Hanzo Conard
Quiz by , created more than 1 year ago

Quiz on SPD, created by Hanzo Conard on 24/05/2017.

373
0
0
Hanzo Conard
Created by Hanzo Conard over 7 years ago
Close

SPD

Question 1 of 70

1

What are two parts of ADT?

Select one of the following:

  • Private and Public

  • ArrayList and Vector

  • Queue and Stack

  • Parent and Child

  • Int and float

Explanation

Question 2 of 70

1

Which of them has more methods?

Select one of the following:

  • Superclass

  • Subclass

Explanation

Question 3 of 70

1

The relationship when one class is a subclass of another is called...

Select one of the following:

  • is-a

  • has-a

Explanation

Question 4 of 70

1

The relationship when one class is defined inside the definition of another is called...

Select one of the following:

  • has-a

  • is-a

  • is-b

  • has-b

  • to-c

Explanation

Question 5 of 70

1

Redefinition of method of superclass in a subclass with the same name and number of parameters is...

Select one of the following:

  • Override

  • Overload

  • Overhead

  • Upperload

  • Overbeat

Explanation

Question 6 of 70

1

Redefinition of method with the same name but different number of parameters is called...

Select one of the following:

  • Overload

  • Override

  • Overflow

  • Upperride

  • Download

Explanation

Question 7 of 70

1

If you want to call the constructor of superclass you would use....

Select one of the following:

  • super.

  • super()

  • this.

  • this()

  • constructor()

Explanation

Question 8 of 70

1

If you want to call data member of superclass you would use...

Select one of the following:

  • super.

  • super()

  • this()

  • this.

  • method()

Explanation

Question 9 of 70

1

If you want to call different constructor of current class you would use...

Select one of the following:

  • this()

  • this.

  • super()

  • super.

  • current.

Explanation

Question 10 of 70

1

If there is at least one abstract method in a class, that class is called...

Select one of the following:

  • Abstract class

  • General class

  • Recursive class

  • Tired class

  • Vanish class

Explanation

Question 11 of 70

1

If there are no abstract methods in the class we call that class…

Select one of the following:

  • Abstract class

  • Actual class

  • Super class

  • Non Abstract class

  • Funny class

Explanation

Question 12 of 70

1

Which part is accessible to user ?

Select one of the following:

  • Public

  • Private

  • Protected

  • Social

  • Interactive

Explanation

Question 13 of 70

1

Is it possible to inherit from multiple classes?

Select one of the following:

  • Yes

  • No

Explanation

Question 14 of 70

1

Is it possible to implement multiple interfaces?

Select one of the following:

  • Yes

  • No

Explanation

Question 15 of 70

1

Every class has _____as a superclass

Select one of the following:

  • Object

  • JAVA

  • Subject

  • Main

  • String

Explanation

Question 16 of 70

1

This method returns a string that textually represents an object

Select one of the following:

  • toString()

  • equals()

  • toText()

  • toGo()

  • hashCode()

Explanation

Question 17 of 70

1

InstanceOf used to test ...

Select one of the following:

  • 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

Explanation

Question 18 of 70

1

What is not perfect in this code: ave = sum/count;

Select one of the following:

  • 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

Explanation

Question 19 of 70

1

Attempt to convert a string that is not numeric to a number faults …

Select one of the following:

  • NumberFormatException

  • ArithmeticException

  • SDP4IsNotASubjectException

  • DoNotSpeakException

  • SadProgrammerException

Explanation

Question 20 of 70

1

Attempt to access array element using index less than zero folds

Select one of the following:

  • ArrayIndexOutOfBoundsException

  • ArithmeticException

  • GoHomeExpception

  • InputMismatchException

  • McDonerException

Explanation

Question 21 of 70

1

________ exception is an error normally due to programmer

Select one of the following:

  • checked

  • unchecked

  • broken

  • cracked

Explanation

Question 22 of 70

1

________ exception is an error normally not due to programmer

Select one of the following:

  • checked

  • unchecked

  • hacked

  • frozen

  • cracked

Explanation

Question 23 of 70

1

Which part is not accessible to user ?

Select one of the following:

  • private

  • shifted

  • controlled

  • based

  • public

Explanation

Question 24 of 70

1

How to handle exceptions?

Select one of the following:

  • try{} catch(){}

  • try{} batch(){}

  • poimai{}menya{}esli{}smozhesh{}

  • fly{}catch(){}

  • go{}home(){}

Explanation

Question 25 of 70

1

Which of the following is not example of visibility in Java ?

Select one of the following:

  • private

  • public

  • protected

  • package

  • eclipsed

Explanation

Question 26 of 70

1

Returns the reference to the element at position index

Select one of the following:

  • get(index)

  • set(index)

  • has(index)

  • goTo(index)

  • fly(index)

Explanation

Question 27 of 70

1

Get the size of ArrayList

Select one of the following:

  • size()

  • size(list)

  • sizeOf()

  • length

  • length(list)

Explanation

Question 28 of 70

1

Sets the element on position Index to reference entry

Select one of the following:

  • set(index, entry)

  • setTo(index, entry)

  • index.set(entry)

  • entry.set(index)

  • set.index(entry)

Explanation

Question 29 of 70

1

Public xxx(int index){
return theData[index];
}
this behavior is similar to which method of ArrayList class?

Select one of the following:

  • get

  • set

  • size

  • equals

Explanation

Question 30 of 70

1

What is the time complexity of insert(index) method in ArrayList

Select one of the following:

  • O(n)

  • O(1)

  • O(logn)

  • O(n^2)

  • O(m*n)

Explanation

Question 31 of 70

1

What is the difference between ArrayList and Vector?

Select one of the following:

  • 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

Explanation

Question 32 of 70

1

for(int i = 0; i < size; i++) {
If(theData[i] == entry) {
Return i;
}
Return -1;
}
This method is similar to which method of ArrayList

Select one of the following:

  • indexOf(entry)

  • get(entry)

  • set(entry)

Explanation

Question 33 of 70

1

Indicate constant time complexity in terms of Big-O notation

Select one of the following:

  • O(1)

  • O(n)

  • O(n^2)

  • O(const)

  • O(logn)

Explanation

Question 34 of 70

1

The collection of abstract methods is called ...

Select one of the following:

  • Interface

  • Abstract class

  • Class

  • Method

  • Function

Explanation

Question 35 of 70

1

Indicate logarithm time complexity in terms of big-O notation?

Select one of the following:

  • O(logn)

  • O(n^2)

  • O(n)

  • O(1)

  • O(done)

Explanation

Question 36 of 70

1

Indicate linear time complexity in terms of big-O notation?

Select one of the following:

  • O(n)

  • O(n^2)

  • O(n^3)

  • O(logn)

  • O(loglogn)

Explanation

Question 37 of 70

1

Indicate exponential time complexity in terms of big-O notation?

Select one of the following:

  • O(2^n)

  • O(n^2)

  • O(logn)

  • O(n)

  • O(n^4)

Explanation

Question 38 of 70

1

Find the slowest time

Select one of the following:

  • O(n!)

  • O(2^n)

  • O(n)

  • O(n^4)

  • O(100)

Explanation

Question 39 of 70

1

What is the time complexity of ArrayList remove(index) method

Select one of the following:

  • O(n)

  • O(1)

  • O(n * n)

  • O(logn)

  • O(n^3)

Explanation

Question 40 of 70

1

What is the time complexity of adding an item in front of a LinkedList

Select one of the following:

  • O(1)

  • O(n)

  • O(n^2)

  • O(n^3)

  • O(nlogn)

Explanation

Question 41 of 70

1

What is the time complexity of adding element in the beginning of ArrayList

Select one of the following:

  • O(n)

  • O(1)

  • O(logn)

  • O(nlogn)

  • O(n^2)

Explanation

Question 42 of 70

1

Which method searches for target and returns its position in LinkedList?

Select one of the following:

  • indexOf(target)

  • get(target)

  • set(target)

  • equal(target)

Explanation

Question 43 of 70

1

Indicate polynomial time complexity

Select one of the following:

  • O(n^const) (const = 2,3…)

  • O(nlogn)

  • O(logn)

  • O(2^n)

  • O(1)

Explanation

Question 44 of 70

1

How to remove item from LinkedList?

Select one of the following:

  • 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

Explanation

Question 45 of 70

1

What is attribute of CircularList

Select one of the following:

  • 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

Explanation

Question 46 of 70

1

Which of the following in Java is very similar to “contract” ?

Select one of the following:

  • Interface implementation

  • Class inheritance

  • Method overloading

  • Class overriding

Explanation

Question 47 of 70

1

List iterator and iterator is the same thing in JAVA

Select one of the following:

  • True
  • False

Explanation

Question 48 of 70

1

Is it possible to traverse containing of a list this way?
for(int nextInt : aList) {… }

Select one of the following:

  • Yes

  • No

  • May be

  • I don't know

Explanation

Question 49 of 70

1

Show the method which exists in a DoubleLinkedList and not exist in a SingleLinkedList

Select one of the following:

  • constructor

  • next()

  • hasNext()

  • previous()

  • hasBefore()

Explanation

Question 50 of 70

1

What relationship class Node and LinkedList have?

Select one of the following:

  • is-a

  • has-a

  • Is-b

  • to-c

  • They are couple

Explanation

Question 51 of 70

1

Which of them is NOT an example of Data Structure ?

Select one of the following:

  • Breadth First Search

  • ArrayList

  • Graph

  • Priority Queue

  • Set

Explanation

Question 52 of 70

1

Which of them is NOT feature of collection interface ?

Select one of the following:

  • Graph

  • Set

  • List

  • Queue

  • Vector

Explanation

Question 53 of 70

1

This returns TRUE if the collection contains object

Select one of the following:

  • contains(obj)

  • IndexOf(obj)

  • IndexF(obj)

  • find(obj)

  • goTo(obj)

Explanation

Question 54 of 70

1

Elements of a List are accessed by means of an

Select one of the following:

  • index

  • switch

  • position

  • loop

  • book

Explanation

Question 55 of 70

1

A list can ___ or ___ as items(elements) are added or removed

Select one of the following:

  • grow, shrink

  • flow, shrink

  • increase, grow

  • decrease, think

  • fly, sit

Explanation

Question 56 of 70

1

OOP stands for?

Select one of the following:

  • Object oriented programming

  • Obstacle oriented programming

  • Object oriented playing

  • Omar oriented programming

Explanation

Question 57 of 70

1

The Collection is a _____ of a List ?

Select one of the following:

  • superinterface

  • parent

  • interface

  • father

  • node

Explanation

Question 58 of 70

1

Which method returns an object at the top of a Stack in JAVA?

Select one of the following:

  • pop()

  • peek()

  • front()

  • poll()

  • top()

Explanation

Question 59 of 70

1

Which method adds an item on the top of a Stack in JAVA?

Select one of the following:

  • push()

  • add()

  • peek()

  • top()

  • bush()

Explanation

Question 60 of 70

1

First in last out structure is ...

Select one of the following:

  • Stack

  • Queue

  • Graph

  • Set

  • Tree

Explanation

Question 61 of 70

1

Which structure is widely used in finding palindrome?

Select one of the following:

  • Stack

  • Queue

  • Set

  • Map

  • Graph

Explanation

Question 62 of 70

1

Which structure is widely used to calculate the value of postfix expression?

Select one of the following:

  • Queue

  • Stack

  • Set

  • Graph

  • List

Explanation

Question 63 of 70

1

Calculate value of “4 7 * 20-“

Select one of the following:

  • 8

  • 1

  • 136

  • 144

  • 3

Explanation

Question 64 of 70

1

Ability of object of one class to act like it is an object of another class

Select one of the following:

  • Polymorphism

  • Encapsulation

  • Inheritance

  • Java code

  • SLOC(Source Line Of Code)

Explanation

Question 65 of 70

1

What does method empty return for empty stack?

Select one of the following:

  • True

  • False

  • Nothing

  • Empty

  • Hello

Explanation

Question 66 of 70

1

Waiting line of people is similar to which data structure?

Select one of the following:

  • Queue

  • Stack

  • Tree

  • Graph

  • LinkedList

Explanation

Question 67 of 70

1

If we call remove() function for the queue, which item will be removed

Select one of the following:

  • first

  • last

  • middle

  • second

  • third

Explanation

Question 68 of 70

1

Which function return first added item in the queue?

Select one of the following:

  • front()

  • first()

  • element()

  • goBack()

  • giveMeFirst()

Explanation

Question 69 of 70

1

Which function is used to add new item in the queue?

Select one of the following:

  • offer()

  • suffer()

  • add()

  • poll()

  • remove()

Explanation

Question 70 of 70

1

First-in first-out data structure ...

Select one of the following:

  • Queue

  • Stack

  • Set

  • Graph

  • List

Explanation