SPD

Descrição

Quiz sobre SPD, criado por Hanzo Conard em 24-05-2017.
Hanzo Conard
Quiz por Hanzo Conard, atualizado more than 1 year ago
Hanzo Conard
Criado por Hanzo Conard mais de 7 anos atrás
371
0

Resumo de Recurso

Questão 1

Questão
What are two parts of ADT?
Responda
  • Private and Public
  • ArrayList and Vector
  • Queue and Stack
  • Parent and Child
  • Int and float

Questão 2

Questão
Which of them has more methods?
Responda
  • Superclass
  • Subclass

Questão 3

Questão
The relationship when one class is a subclass of another is called...
Responda
  • is-a
  • has-a

Questão 4

Questão
The relationship when one class is defined inside the definition of another is called...
Responda
  • has-a
  • is-a
  • is-b
  • has-b
  • to-c

Questão 5

Questão
Redefinition of method of superclass in a subclass with the same name and number of parameters is...
Responda
  • Override
  • Overload
  • Overhead
  • Upperload
  • Overbeat

Questão 6

Questão
Redefinition of method with the same name but different number of parameters is called...
Responda
  • Overload
  • Override
  • Overflow
  • Upperride
  • Download

Questão 7

Questão
If you want to call the constructor of superclass you would use....
Responda
  • super.
  • super()
  • this.
  • this()
  • constructor()

Questão 8

Questão
If you want to call data member of superclass you would use...
Responda
  • super.
  • super()
  • this()
  • this.
  • method()

Questão 9

Questão
If you want to call different constructor of current class you would use...
Responda
  • this()
  • this.
  • super()
  • super.
  • current.

Questão 10

Questão
If there is at least one abstract method in a class, that class is called...
Responda
  • Abstract class
  • General class
  • Recursive class
  • Tired class
  • Vanish class

Questão 11

Questão
If there are no abstract methods in the class we call that class…
Responda
  • Abstract class
  • Actual class
  • Super class
  • Non Abstract class
  • Funny class

Questão 12

Questão
Which part is accessible to user ?
Responda
  • Public
  • Private
  • Protected
  • Social
  • Interactive

Questão 13

Questão
Is it possible to inherit from multiple classes?
Responda
  • Yes
  • No

Questão 14

Questão
Is it possible to implement multiple interfaces?
Responda
  • Yes
  • No

Questão 15

Questão
Every class has _____as a superclass
Responda
  • Object
  • JAVA
  • Subject
  • Main
  • String

Questão 16

Questão
This method returns a string that textually represents an object
Responda
  • toString()
  • equals()
  • toText()
  • toGo()
  • hashCode()

Questão 17

Questão
InstanceOf used to test ...
Responda
  • 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

Questão 18

Questão
What is not perfect in this code: ave = sum/count;
Responda
  • 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

Questão 19

Questão
Attempt to convert a string that is not numeric to a number faults …
Responda
  • NumberFormatException
  • ArithmeticException
  • SDP4IsNotASubjectException
  • DoNotSpeakException
  • SadProgrammerException

Questão 20

Questão
Attempt to access array element using index less than zero folds
Responda
  • ArrayIndexOutOfBoundsException
  • ArithmeticException
  • GoHomeExpception
  • InputMismatchException
  • McDonerException

Questão 21

Questão
________ exception is an error normally due to programmer
Responda
  • checked
  • unchecked
  • broken
  • cracked

Questão 22

Questão
________ exception is an error normally not due to programmer
Responda
  • checked
  • unchecked
  • hacked
  • frozen
  • cracked

Questão 23

Questão
Which part is not accessible to user ?
Responda
  • private
  • shifted
  • controlled
  • based
  • public

Questão 24

Questão
How to handle exceptions?
Responda
  • try{} catch(){}
  • try{} batch(){}
  • poimai{}menya{}esli{}smozhesh{}
  • fly{}catch(){}
  • go{}home(){}

Questão 25

Questão
Which of the following is not example of visibility in Java ?
Responda
  • private
  • public
  • protected
  • package
  • eclipsed

Questão 26

Questão
Returns the reference to the element at position index
Responda
  • get(index)
  • set(index)
  • has(index)
  • goTo(index)
  • fly(index)

Questão 27

Questão
Get the size of ArrayList
Responda
  • size()
  • size(list)
  • sizeOf()
  • length
  • length(list)

Questão 28

Questão
Sets the element on position Index to reference entry
Responda
  • set(index, entry)
  • setTo(index, entry)
  • index.set(entry)
  • entry.set(index)
  • set.index(entry)

Questão 29

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

Questão 30

Questão
What is the time complexity of insert(index) method in ArrayList
Responda
  • O(n)
  • O(1)
  • O(logn)
  • O(n^2)
  • O(m*n)

Questão 31

Questão
What is the difference between ArrayList and Vector?
Responda
  • 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

Questão 32

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

Questão 33

Questão
Indicate constant time complexity in terms of Big-O notation
Responda
  • O(1)
  • O(n)
  • O(n^2)
  • O(const)
  • O(logn)

Questão 34

Questão
The collection of abstract methods is called ...
Responda
  • Interface
  • Abstract class
  • Class
  • Method
  • Function

Questão 35

Questão
Indicate logarithm time complexity in terms of big-O notation?
Responda
  • O(logn)
  • O(n^2)
  • O(n)
  • O(1)
  • O(done)

Questão 36

Questão
Indicate linear time complexity in terms of big-O notation?
Responda
  • O(n)
  • O(n^2)
  • O(n^3)
  • O(logn)
  • O(loglogn)

Questão 37

Questão
Indicate exponential time complexity in terms of big-O notation?
Responda
  • O(2^n)
  • O(n^2)
  • O(logn)
  • O(n)
  • O(n^4)

Questão 38

Questão
Find the slowest time
Responda
  • O(n!)
  • O(2^n)
  • O(n)
  • O(n^4)
  • O(100)

Questão 39

Questão
What is the time complexity of ArrayList remove(index) method
Responda
  • O(n)
  • O(1)
  • O(n * n)
  • O(logn)
  • O(n^3)

Questão 40

Questão
What is the time complexity of adding an item in front of a LinkedList
Responda
  • O(1)
  • O(n)
  • O(n^2)
  • O(n^3)
  • O(nlogn)

Questão 41

Questão
What is the time complexity of adding element in the beginning of ArrayList
Responda
  • O(n)
  • O(1)
  • O(logn)
  • O(nlogn)
  • O(n^2)

Questão 42

Questão
Which method searches for target and returns its position in LinkedList?
Responda
  • indexOf(target)
  • get(target)
  • set(target)
  • equal(target)

Questão 43

Questão
Indicate polynomial time complexity
Responda
  • O(n^const) (const = 2,3…)
  • O(nlogn)
  • O(logn)
  • O(2^n)
  • O(1)

Questão 44

Questão
How to remove item from LinkedList?
Responda
  • 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

Questão 45

Questão
What is attribute of CircularList
Responda
  • 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

Questão 46

Questão
Which of the following in Java is very similar to “contract” ?
Responda
  • Interface implementation
  • Class inheritance
  • Method overloading
  • Class overriding

Questão 47

Questão
List iterator and iterator is the same thing in JAVA
Responda
  • True
  • False

Questão 48

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

Questão 49

Questão
Show the method which exists in a DoubleLinkedList and not exist in a SingleLinkedList
Responda
  • constructor
  • next()
  • hasNext()
  • previous()
  • hasBefore()

Questão 50

Questão
What relationship class Node and LinkedList have?
Responda
  • is-a
  • has-a
  • Is-b
  • to-c
  • They are couple

Questão 51

Questão
Which of them is NOT an example of Data Structure ?
Responda
  • Breadth First Search
  • ArrayList
  • Graph
  • Priority Queue
  • Set

Questão 52

Questão
Which of them is NOT feature of collection interface ?
Responda
  • Graph
  • Set
  • List
  • Queue
  • Vector

Questão 53

Questão
This returns TRUE if the collection contains object
Responda
  • contains(obj)
  • IndexOf(obj)
  • IndexF(obj)
  • find(obj)
  • goTo(obj)

Questão 54

Questão
Elements of a List are accessed by means of an
Responda
  • index
  • switch
  • position
  • loop
  • book

Questão 55

Questão
A list can ___ or ___ as items(elements) are added or removed
Responda
  • grow, shrink
  • flow, shrink
  • increase, grow
  • decrease, think
  • fly, sit

Questão 56

Questão
OOP stands for?
Responda
  • Object oriented programming
  • Obstacle oriented programming
  • Object oriented playing
  • Omar oriented programming

Questão 57

Questão
The Collection is a _____ of a List ?
Responda
  • superinterface
  • parent
  • interface
  • father
  • node

Questão 58

Questão
Which method returns an object at the top of a Stack in JAVA?
Responda
  • pop()
  • peek()
  • front()
  • poll()
  • top()

Questão 59

Questão
Which method adds an item on the top of a Stack in JAVA?
Responda
  • push()
  • add()
  • peek()
  • top()
  • bush()

Questão 60

Questão
First in last out structure is ...
Responda
  • Stack
  • Queue
  • Graph
  • Set
  • Tree

Questão 61

Questão
Which structure is widely used in finding palindrome?
Responda
  • Stack
  • Queue
  • Set
  • Map
  • Graph

Questão 62

Questão
Which structure is widely used to calculate the value of postfix expression?
Responda
  • Queue
  • Stack
  • Set
  • Graph
  • List

Questão 63

Questão
Calculate value of “4 7 * 20-“
Responda
  • 8
  • 1
  • 136
  • 144
  • 3

Questão 64

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

Questão 65

Questão
What does method empty return for empty stack?
Responda
  • True
  • False
  • Nothing
  • Empty
  • Hello

Questão 66

Questão
Waiting line of people is similar to which data structure?
Responda
  • Queue
  • Stack
  • Tree
  • Graph
  • LinkedList

Questão 67

Questão
If we call remove() function for the queue, which item will be removed
Responda
  • first
  • last
  • middle
  • second
  • third

Questão 68

Questão
Which function return first added item in the queue?
Responda
  • front()
  • first()
  • element()
  • goBack()
  • giveMeFirst()

Questão 69

Questão
Which function is used to add new item in the queue?
Responda
  • offer()
  • suffer()
  • add()
  • poll()
  • remove()

Questão 70

Questão
First-in first-out data structure ...
Responda
  • Queue
  • Stack
  • Set
  • Graph
  • List

Semelhante

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