Quiz
SPD
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (70)
1What are two parts of ADT?
- APrivate and Public
- BArrayList and Vector
- CQueue and Stack
- DParent and Child
- EInt and float
2Which of them has more methods?
- ASuperclass
- BSubclass
3The relationship when one class is a subclass of another is called...
- Ais-a
- Bhas-a
4The relationship when one class is defined inside the definition of another is called...
- Ahas-a
- Bis-a
- Cis-b
- Dhas-b
- Eto-c
5Redefinition of method of superclass in a subclass with the same name and number of parameters is...
- AOverride
- BOverload
- COverhead
- DUpperload
- EOverbeat
6Redefinition of method with the same name but different number of parameters is called...
- AOverload
- BOverride
- COverflow
- DUpperride
- EDownload
7If you want to call the constructor of superclass you would use....
- Asuper.
- Bsuper()
- Cthis.
- Dthis()
- Econstructor()
8If you want to call data member of superclass you would use...
- Asuper.
- Bsuper()
- Cthis()
- Dthis.
- Emethod()
9If you want to call different constructor of current class you would use...
- Athis()
- Bthis.
- Csuper()
- Dsuper.
- Ecurrent.
10If there is at least one abstract method in a class, that class is called...
- AAbstract class
- BGeneral class
- CRecursive class
- DTired class
- EVanish class
11If there are no abstract methods in the class we call that class…
- AAbstract class
- BActual class
- CSuper class
- DNon Abstract class
- EFunny class
12Which part is accessible to user ?
- APublic
- BPrivate
- CProtected
- DSocial
- EInteractive
13Is it possible to inherit from multiple classes?
- AYes
- BNo
14Is it possible to implement multiple interfaces?
- AYes
- BNo
15Every class has _____as a superclass
- AObject
- BJAVA
- CSubject
- DMain
- EString
16This method returns a string that textually represents an object
- AtoString()
- Bequals()
- CtoText()
- DtoGo()
- EhashCode()
17InstanceOf used to test ...
- AWhether an object belongs to class or not
- BWhether object is object or not
- CWhether object plays football or not
- DWhether object has parent or not
- EWhether is the biggest object or not
18What is not perfect in this code: ave = sum/count;
- ADivision by zero may occur
- BMultiplication by 1000000 is impossible in JAVA
- CSemicolon needed after =
- Dave should be written as average
- EIt is not JAVA code
19Attempt to convert a string that is not numeric to a number faults …
- ANumberFormatException
- BArithmeticException
- CSDP4IsNotASubjectException
- DDoNotSpeakException
- ESadProgrammerException
20Attempt to access array element using index less than zero folds
- AArrayIndexOutOfBoundsException
- BArithmeticException
- CGoHomeExpception
- DInputMismatchException
- EMcDonerException
21________ exception is an error normally due to programmer
- Achecked
- Bunchecked
- Cbroken
- Dcracked
22________ exception is an error normally not due to programmer
- Achecked
- Bunchecked
- Chacked
- Dfrozen
- Ecracked
23Which part is not accessible to user ?
- Aprivate
- Bshifted
- Ccontrolled
- Dbased
- Epublic
24How to handle exceptions?
- Atry{} catch(){}
- Btry{} batch(){}
- Cpoimai{}menya{}esli{}smozhesh{}
- Dfly{}catch(){}
- Ego{}home(){}
25Which of the following is not example of visibility in Java ?
- Aprivate
- Bpublic
- Cprotected
- Dpackage
- Eeclipsed
26Returns the reference to the element at position index
- Aget(index)
- Bset(index)
- Chas(index)
- DgoTo(index)
- Efly(index)
27Get the size of ArrayList
- Asize()
- Bsize(list)
- CsizeOf()
- Dlength
- Elength(list)
28Sets the element on position Index to reference entry
- Aset(index, entry)
- BsetTo(index, entry)
- Cindex.set(entry)
- Dentry.set(index)
- Eset.index(entry)
29Public xxx(int index){
return theData[index];
}
this behavior is similar to which method of ArrayList class?- Aget
- Bset
- Csize
- Dequals
30What is the time complexity of insert(index) method in ArrayList
- AO(n)
- BO(1)
- CO(logn)
- DO(n^2)
- EO(m*n)
31What is the difference between ArrayList and Vector?
- AVector is synchronized, where ArrayList is not
- BVector is scalable, where ArrayList is not
- CVector is flexible, where ArrayList is not
- DVector is resizable, where ArrayList is not
- EThere is no difference
32for(int i = 0; i < size; i++) {
If(theData[i] == entry) {
Return i;
}
Return -1;
}
This method is similar to which method of ArrayList- AindexOf(entry)
- Bget(entry)
- Cset(entry)
33Indicate constant time complexity in terms of Big-O notation
- AO(1)
- BO(n)
- CO(n^2)
- DO(const)
- EO(logn)
34The collection of abstract methods is called ...
- AInterface
- BAbstract class
- CClass
- DMethod
- EFunction
35Indicate logarithm time complexity in terms of big-O notation?
- AO(logn)
- BO(n^2)
- CO(n)
- DO(1)
- EO(done)
36Indicate linear time complexity in terms of big-O notation?
- AO(n)
- BO(n^2)
- CO(n^3)
- DO(logn)
- EO(loglogn)
37Indicate exponential time complexity in terms of big-O notation?
- AO(2^n)
- BO(n^2)
- CO(logn)
- DO(n)
- EO(n^4)
38Find the slowest time
- AO(n!)
- BO(2^n)
- CO(n)
- DO(n^4)
- EO(100)
39What is the time complexity of ArrayList remove(index) method
- AO(n)
- BO(1)
- CO(n * n)
- DO(logn)
- EO(n^3)
40What is the time complexity of adding an item in front of a LinkedList
- AO(1)
- BO(n)
- CO(n^2)
- DO(n^3)
- EO(nlogn)
41What is the time complexity of adding element in the beginning of ArrayList
- AO(n)
- BO(1)
- CO(logn)
- DO(nlogn)
- EO(n^2)
42Which method searches for target and returns its position in LinkedList?
- AindexOf(target)
- Bget(target)
- Cset(target)
- Dequal(target)
43Indicate polynomial time complexity
- AO(n^const) (const = 2,3…)
- BO(nlogn)
- CO(logn)
- DO(2^n)
- EO(1)
44How to remove item from LinkedList?
- AChange Link of previous item to next item of item to be removed
- BChange Link of next item to previous item of item to be removed
- CChange Link of removing item to next
- DChange Link of removing item to previous
- EGo home and cry
45What is attribute of CircularList
- ANext of last item referencing to the first item
- BNext of first item referencing to the last item
- CPrev of last item referencing to the last item
- DNext of best item referencing to the worst item
- EI need to go home and prepare this
46Which of the following in Java is very similar to “contract” ?
- AInterface implementation
- BClass inheritance
- CMethod overloading
- DClass overriding
47List iterator and iterator is the same thing in JAVA
- ATrue
- BFalse
48Is it possible to traverse containing of a list this way?
for(int nextInt : aList) {… }- AYes
- BNo
- CMay be
- DI don't know
49Show the method which exists in a DoubleLinkedList and not exist in a SingleLinkedList
- Aconstructor
- Bnext()
- ChasNext()
- Dprevious()
- EhasBefore()
50What relationship class Node and LinkedList have?
- Ais-a
- Bhas-a
- CIs-b
- Dto-c
- EThey are couple
51Which of them is NOT an example of Data Structure ?
- ABreadth First Search
- BArrayList
- CGraph
- DPriority Queue
- ESet
52Which of them is NOT feature of collection interface ?
- AGraph
- BSet
- CList
- DQueue
- EVector
53This returns TRUE if the collection contains object
- Acontains(obj)
- BIndexOf(obj)
- CIndexF(obj)
- Dfind(obj)
- EgoTo(obj)
54Elements of a List are accessed by means of an
- Aindex
- Bswitch
- Cposition
- Dloop
- Ebook
55A list can ___ or ___ as items(elements) are added or removed
- Agrow, shrink
- Bflow, shrink
- Cincrease, grow
- Ddecrease, think
- Efly, sit
56OOP stands for?
- AObject oriented programming
- BObstacle oriented programming
- CObject oriented playing
- DOmar oriented programming
57The Collection is a _____ of a List ?
- Asuperinterface
- Bparent
- Cinterface
- Dfather
- Enode
58Which method returns an object at the top of a Stack in JAVA?
- Apop()
- Bpeek()
- Cfront()
- Dpoll()
- Etop()
59Which method adds an item on the top of a Stack in JAVA?
- Apush()
- Badd()
- Cpeek()
- Dtop()
- Ebush()
60First in last out structure is ...
- AStack
- BQueue
- CGraph
- DSet
- ETree
61Which structure is widely used in finding palindrome?
- AStack
- BQueue
- CSet
- DMap
- EGraph
62Which structure is widely used to calculate the value of postfix expression?
- AQueue
- BStack
- CSet
- DGraph
- EList
63Calculate value of “4 7 * 20-“
- A8
- B1
- C136
- D144
- E3
64Ability of object of one class to act like it is an object of another class
- APolymorphism
- BEncapsulation
- CInheritance
- DJava code
- ESLOC(Source Line Of Code)
65What does method empty return for empty stack?
- ATrue
- BFalse
- CNothing
- DEmpty
- EHello
66Waiting line of people is similar to which data structure?
- AQueue
- BStack
- CTree
- DGraph
- ELinkedList
67If we call remove() function for the queue, which item will be removed
- Afirst
- Blast
- Cmiddle
- Dsecond
- Ethird
68Which function return first added item in the queue?
- Afront()
- Bfirst()
- Celement()
- DgoBack()
- EgiveMeFirst()
69Which function is used to add new item in the queue?
- Aoffer()
- Bsuffer()
- Cadd()
- Dpoll()
- Eremove()
70First-in first-out data structure ...
- AQueue
- BStack
- CSet
- DGraph
- EList
Information
- Description
- Quiz on SPD, created by Hanzo Conard on 24/05/2017.
- Author
- Hanzo Conard
- Language
- English
- Views
- 412
- Tags
- Rating
- No ratings yet Rate this quiz