SPD

Description

Quiz on SPD, created by Hanzo Conard on 24/05/2017.
Hanzo Conard
Quiz by Hanzo Conard, updated more than 1 year ago
Hanzo Conard
Created by Hanzo Conard over 7 years ago
371
0

Resource summary

Question 1

Question
What are two parts of ADT?
Answer
  • Private and Public
  • ArrayList and Vector
  • Queue and Stack
  • Parent and Child
  • Int and float

Question 2

Question
Which of them has more methods?
Answer
  • Superclass
  • Subclass

Question 3

Question
The relationship when one class is a subclass of another is called...
Answer
  • is-a
  • has-a

Question 4

Question
The relationship when one class is defined inside the definition of another is called...
Answer
  • has-a
  • is-a
  • is-b
  • has-b
  • to-c

Question 5

Question
Redefinition of method of superclass in a subclass with the same name and number of parameters is...
Answer
  • Override
  • Overload
  • Overhead
  • Upperload
  • Overbeat

Question 6

Question
Redefinition of method with the same name but different number of parameters is called...
Answer
  • Overload
  • Override
  • Overflow
  • Upperride
  • Download

Question 7

Question
If you want to call the constructor of superclass you would use....
Answer
  • super.
  • super()
  • this.
  • this()
  • constructor()

Question 8

Question
If you want to call data member of superclass you would use...
Answer
  • super.
  • super()
  • this()
  • this.
  • method()

Question 9

Question
If you want to call different constructor of current class you would use...
Answer
  • this()
  • this.
  • super()
  • super.
  • current.

Question 10

Question
If there is at least one abstract method in a class, that class is called...
Answer
  • Abstract class
  • General class
  • Recursive class
  • Tired class
  • Vanish class

Question 11

Question
If there are no abstract methods in the class we call that class…
Answer
  • Abstract class
  • Actual class
  • Super class
  • Non Abstract class
  • Funny class

Question 12

Question
Which part is accessible to user ?
Answer
  • Public
  • Private
  • Protected
  • Social
  • Interactive

Question 13

Question
Is it possible to inherit from multiple classes?
Answer
  • Yes
  • No

Question 14

Question
Is it possible to implement multiple interfaces?
Answer
  • Yes
  • No

Question 15

Question
Every class has _____as a superclass
Answer
  • Object
  • JAVA
  • Subject
  • Main
  • String

Question 16

Question
This method returns a string that textually represents an object
Answer
  • toString()
  • equals()
  • toText()
  • toGo()
  • hashCode()

Question 17

Question
InstanceOf used to test ...
Answer
  • 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

Question 18

Question
What is not perfect in this code: ave = sum/count;
Answer
  • 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

Question 19

Question
Attempt to convert a string that is not numeric to a number faults …
Answer
  • NumberFormatException
  • ArithmeticException
  • SDP4IsNotASubjectException
  • DoNotSpeakException
  • SadProgrammerException

Question 20

Question
Attempt to access array element using index less than zero folds
Answer
  • ArrayIndexOutOfBoundsException
  • ArithmeticException
  • GoHomeExpception
  • InputMismatchException
  • McDonerException

Question 21

Question
________ exception is an error normally due to programmer
Answer
  • checked
  • unchecked
  • broken
  • cracked

Question 22

Question
________ exception is an error normally not due to programmer
Answer
  • checked
  • unchecked
  • hacked
  • frozen
  • cracked

Question 23

Question
Which part is not accessible to user ?
Answer
  • private
  • shifted
  • controlled
  • based
  • public

Question 24

Question
How to handle exceptions?
Answer
  • try{} catch(){}
  • try{} batch(){}
  • poimai{}menya{}esli{}smozhesh{}
  • fly{}catch(){}
  • go{}home(){}

Question 25

Question
Which of the following is not example of visibility in Java ?
Answer
  • private
  • public
  • protected
  • package
  • eclipsed

Question 26

Question
Returns the reference to the element at position index
Answer
  • get(index)
  • set(index)
  • has(index)
  • goTo(index)
  • fly(index)

Question 27

Question
Get the size of ArrayList
Answer
  • size()
  • size(list)
  • sizeOf()
  • length
  • length(list)

Question 28

Question
Sets the element on position Index to reference entry
Answer
  • set(index, entry)
  • setTo(index, entry)
  • index.set(entry)
  • entry.set(index)
  • set.index(entry)

Question 29

Question
Public xxx(int index){ return theData[index]; } this behavior is similar to which method of ArrayList class?
Answer
  • get
  • set
  • size
  • equals

Question 30

Question
What is the time complexity of insert(index) method in ArrayList
Answer
  • O(n)
  • O(1)
  • O(logn)
  • O(n^2)
  • O(m*n)

Question 31

Question
What is the difference between ArrayList and Vector?
Answer
  • 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

Question 32

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

Question 33

Question
Indicate constant time complexity in terms of Big-O notation
Answer
  • O(1)
  • O(n)
  • O(n^2)
  • O(const)
  • O(logn)

Question 34

Question
The collection of abstract methods is called ...
Answer
  • Interface
  • Abstract class
  • Class
  • Method
  • Function

Question 35

Question
Indicate logarithm time complexity in terms of big-O notation?
Answer
  • O(logn)
  • O(n^2)
  • O(n)
  • O(1)
  • O(done)

Question 36

Question
Indicate linear time complexity in terms of big-O notation?
Answer
  • O(n)
  • O(n^2)
  • O(n^3)
  • O(logn)
  • O(loglogn)

Question 37

Question
Indicate exponential time complexity in terms of big-O notation?
Answer
  • O(2^n)
  • O(n^2)
  • O(logn)
  • O(n)
  • O(n^4)

Question 38

Question
Find the slowest time
Answer
  • O(n!)
  • O(2^n)
  • O(n)
  • O(n^4)
  • O(100)

Question 39

Question
What is the time complexity of ArrayList remove(index) method
Answer
  • O(n)
  • O(1)
  • O(n * n)
  • O(logn)
  • O(n^3)

Question 40

Question
What is the time complexity of adding an item in front of a LinkedList
Answer
  • O(1)
  • O(n)
  • O(n^2)
  • O(n^3)
  • O(nlogn)

Question 41

Question
What is the time complexity of adding element in the beginning of ArrayList
Answer
  • O(n)
  • O(1)
  • O(logn)
  • O(nlogn)
  • O(n^2)

Question 42

Question
Which method searches for target and returns its position in LinkedList?
Answer
  • indexOf(target)
  • get(target)
  • set(target)
  • equal(target)

Question 43

Question
Indicate polynomial time complexity
Answer
  • O(n^const) (const = 2,3…)
  • O(nlogn)
  • O(logn)
  • O(2^n)
  • O(1)

Question 44

Question
How to remove item from LinkedList?
Answer
  • 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

Question 45

Question
What is attribute of CircularList
Answer
  • 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

Question 46

Question
Which of the following in Java is very similar to “contract” ?
Answer
  • Interface implementation
  • Class inheritance
  • Method overloading
  • Class overriding

Question 47

Question
List iterator and iterator is the same thing in JAVA
Answer
  • True
  • False

Question 48

Question
Is it possible to traverse containing of a list this way? for(int nextInt : aList) {… }
Answer
  • Yes
  • No
  • May be
  • I don't know

Question 49

Question
Show the method which exists in a DoubleLinkedList and not exist in a SingleLinkedList
Answer
  • constructor
  • next()
  • hasNext()
  • previous()
  • hasBefore()

Question 50

Question
What relationship class Node and LinkedList have?
Answer
  • is-a
  • has-a
  • Is-b
  • to-c
  • They are couple

Question 51

Question
Which of them is NOT an example of Data Structure ?
Answer
  • Breadth First Search
  • ArrayList
  • Graph
  • Priority Queue
  • Set

Question 52

Question
Which of them is NOT feature of collection interface ?
Answer
  • Graph
  • Set
  • List
  • Queue
  • Vector

Question 53

Question
This returns TRUE if the collection contains object
Answer
  • contains(obj)
  • IndexOf(obj)
  • IndexF(obj)
  • find(obj)
  • goTo(obj)

Question 54

Question
Elements of a List are accessed by means of an
Answer
  • index
  • switch
  • position
  • loop
  • book

Question 55

Question
A list can ___ or ___ as items(elements) are added or removed
Answer
  • grow, shrink
  • flow, shrink
  • increase, grow
  • decrease, think
  • fly, sit

Question 56

Question
OOP stands for?
Answer
  • Object oriented programming
  • Obstacle oriented programming
  • Object oriented playing
  • Omar oriented programming

Question 57

Question
The Collection is a _____ of a List ?
Answer
  • superinterface
  • parent
  • interface
  • father
  • node

Question 58

Question
Which method returns an object at the top of a Stack in JAVA?
Answer
  • pop()
  • peek()
  • front()
  • poll()
  • top()

Question 59

Question
Which method adds an item on the top of a Stack in JAVA?
Answer
  • push()
  • add()
  • peek()
  • top()
  • bush()

Question 60

Question
First in last out structure is ...
Answer
  • Stack
  • Queue
  • Graph
  • Set
  • Tree

Question 61

Question
Which structure is widely used in finding palindrome?
Answer
  • Stack
  • Queue
  • Set
  • Map
  • Graph

Question 62

Question
Which structure is widely used to calculate the value of postfix expression?
Answer
  • Queue
  • Stack
  • Set
  • Graph
  • List

Question 63

Question
Calculate value of “4 7 * 20-“
Answer
  • 8
  • 1
  • 136
  • 144
  • 3

Question 64

Question
Ability of object of one class to act like it is an object of another class
Answer
  • Polymorphism
  • Encapsulation
  • Inheritance
  • Java code
  • SLOC(Source Line Of Code)

Question 65

Question
What does method empty return for empty stack?
Answer
  • True
  • False
  • Nothing
  • Empty
  • Hello

Question 66

Question
Waiting line of people is similar to which data structure?
Answer
  • Queue
  • Stack
  • Tree
  • Graph
  • LinkedList

Question 67

Question
If we call remove() function for the queue, which item will be removed
Answer
  • first
  • last
  • middle
  • second
  • third

Question 68

Question
Which function return first added item in the queue?
Answer
  • front()
  • first()
  • element()
  • goBack()
  • giveMeFirst()

Question 69

Question
Which function is used to add new item in the queue?
Answer
  • offer()
  • suffer()
  • add()
  • poll()
  • remove()

Question 70

Question
First-in first-out data structure ...
Answer
  • Queue
  • Stack
  • Set
  • Graph
  • List
Show full summary Hide full summary

Similar

Translations and transformations of functions
Christine Laurich
AnS 352 Final Exam Vocab Review
michgreg
Psychology 306 Practice Final Quiz
pnguyen540
Anthropology Final-- Part 3-4
Heather McCord
Reading Quizes
Taylor Morris
Physio Quiz
Tina Truong
Waves
kate.siena
Biology - B2 - AQA - GCSE - Exam Style Questions
Josh Anderson
Computer science quiz
Ryan Barton
Anatomy and Physiology
pressey_property
OCR Gateway GCSE P3 Revision Quiz
xhallyx