Test
Java quiz
Este test tiene tipos de pregunta que se abren en el reproductor de siempre.
Preguntas del test (90)
1Can you use == to show that 2 strings are equal?
- AVerdadero
- BFalso
2Do you have to take care of the garbage collection by yourself?
- AVerdadero
- BFalso
3How do you write a switch?
- Aswitch() {}
- BSwitch() {}
- Cswitch{}{}
- Dswitch[]{}
4Is this correct:
string s = "Is this correct"?- AVerdadero
- BFalso
5Is "if else" a decision or repetition control structure?
- Adecision
- Brepetition
6Will this compile:
int i = 0;
if (i = 0){...}- AVerdadero
- BFalso
7How do you get the array length?
- A.size()
- B.length()
- C.getLength()
- D.longitude()
8An object is created with the keyword "new".
- AVerdadero
- BFalso
9How do you call static methods?
- A[objectName].[methodName]
- B[className].[methodName]
- C[className].[objectName].[methodName]
10How are primitive data types passed to a method?
- Aby reference
- Bby value
11Which keyword do you have to use to show that you inherited from a normal class?
- Anext
- Bextends
- Cimplements
- Dadds
12Where does the super-constructor call stand in the constructor?
- Aat last
- Bafter implementing the given values
- Cat first
13Are down-casts save?
- AVerdadero
- BFalso
14Can you create an object from an abstract class?
- AVerdadero
- BFalso
15What kind of class is Collection?
- Aabstract class
- Bnormal class
- Cinterface
16How does a stack work?
- Afirst in first out
- Blast in first out
- Clast in last out
- DNone of these
17How do you go over a collection?
- Areplicator
- Bsupergazer
- Cprogressator
- Diterator
18What kind of control structures are loops?
- ADecision
- BRepetition
- CHeritage
- DImplementation
19Which kind of loops exist?
- Afor-while loop
- Bfor loop
- Cdo-while loop
- Dswitch loop
- Ewhile loop
20In a "while" loop the while statement stands at the end.
- AVerdadero
- BFalso
21The while loop is executed at least once.
- AVerdadero
- BFalso
22The "do-while" loop is executed at least once.
- AVerdadero
- BFalso
23Loops can enter an infinity loop.
- AVerdadero
- BFalso
24Will this compile?
do{
...
}while(boolean_expression)- AVerdadero
- BFalso
25How many semicolons do you put in the for()-statement?
- A0
- B1
- C2
- D3
26What is the best loop if you know how often the repetetive control structure is needed?
- Awhile loop
- Bdo-while loop
- Cfor loop
27The "for" loop will be executed at least once.
- AVerdadero
- BFalso
28What are branching statements doing?
- Aredirect program flow
- Bcatch exceptions
- Cacts as the end of the program
- Dcreates an object
29In a switch what is break doing?
- Askips the just next case
- Bjumps out of the switch
- Cinterrupts the case
30The break statement skips the current iteration of a loop goes to the head of the loop again.
- AVerdadero
- BFalso
31The continue statement jumps out of the loop.
- AVerdadero
- BFalso
32Every method must return a value.
- AVerdadero
- BFalso
33The return statement exits in the method header.
- AVerdadero
- BFalso
34An array can contain many different values of the same type?
- AVerdadero
- BFalso
35An array can contain many different variables of different types at the same time
- AVerdadero
- BFalso
36An array cannot contain nothing at all?
- AVerdadero
- BFalso
37Both of these declarations do the same:
int [] ages;
int ages[];- AVerdadero
- BFalso
38How do you instantiate an array?
- Aint ages[] = new int[100];
- Bint ages[] = int [100];
- Cint ages[] = new int(100);
- Dint ages[] = ages[100];
39The first position of an array is 1.
- AVerdadero
- BFalso
40You can just create arrays for primitive data type.
- AVerdadero
- BFalso
41Is it possible to resize an array?
- AVerdadero
- BFalso
42for(int i=0;i<=arr.length;i++){...} with this you can access the whole array.
- AVerdadero
- BFalso
43The coding in the question before will throw an exception if it is not empty which will that be.
for(int i=0;i<=arr.length;i++){
arr[i] = i};- ANullpointer
- BNot a Number
- CArraylength exception
- DOutofBOundary exception
44Is it possible to put arrays in arrays?
- AVerdadero
- BFalso
45Is it possible to put a third,forth.. array in. So that there will be multible levels of arrays?
- AVerdadero
- BFalso
46Can you access the two dimensional array dogs[][] like this (Given there is data in this array?):
System.out.print( dogs[0][0] );- AVerdadero
- BFalso
47Runtime Errors are not displayed until the program is executed.
- AVerdadero
- BFalso
48public static void main( Strings[] args ) is the starting point of a program.
- AVerdadero
- BFalso
49Identifiers are not case-sensitive.
- AVerdadero
- BFalso
50Choose the possible beginning of an identifier.
- Aunderscore (_)
- Bnumber (5)
- Cdollar sign($)
- Dpercentage sign(%)
51The name of a class should start with a capitalized letter.
- AVerdadero
- BFalso
52It is possible to name a method "If()"
- AVerdadero
- BFalso
53Name the eight primitive data types of Java. Order them starting with the "smallest" [blank_start]__________[blank_end],[blank_start]__________[blank_end],[blank_start]__________[blank_end],[blank_start]__________[blank_end],[blank_start]__________[blank_end],[blank_start]__________[blank_end],[blank_start]__________[blank_end],[blank_start]__________[blank_end]
- Aboolean
- Bchar
- Cbyte
- Dshort
- Einteger
- Flong
- Gfloat
- Hdouble
54It is possible to extend the value of an Integer by appending the A.
- AVerdadero
- BFalso
55float test = 4.356789;
is a...?- Afloat
- Bdouble
- Cint
- Dlong float
- Enothing
56A variable needs
- Adata type
- Bname
- Cvalue
57You can print out variable data with:
System.out.println();- AVerdadero
- BFalso
58Reference Variable store in the memory location:
- Athe data
- Bthe adress
- Cboth
59How is the order of the compliation?
Opt1 + Opt2 * Opt3 - Opt4- Afrom left to right
- Bright to left
- Caddition, substraction, multiplication
- Dmulitplication, addition, substraction
60What does the arthmetic operator "%" do?
- Adivides 2 values
- Bcomputes the remainer of dividing 2 values
- Cchooses the bigger value
61If you add int a and float b, the result is:
- Aint
- Bfloat
- Cdouble
- Dit is not possible
62count++; is the same as
- Acount = count+1;
- Bcount = 1;
- Ccount += 1;
- Dcount = count-1;
63There is not difference between a++ and ++a
- AVerdadero
- BFalso
64The output of relational operators is Integer.
- AVerdadero
- BFalso
65The result of true&&true is
- AVerdadero
- BFalso
66The result of false||true is
- AVerdadero
- BFalso
67The "&" operator does not always evaluates both variables.
- AVerdadero
- BFalso
68The result of false^true is
- AVerdadero
- BFalso
69The logical operator "!" turns the value into
- Anegative
- Bthe opposite
- Cpositive
70The conditional operator consists out of
- A2 arguments
- B4 arguments
- C3 arguments
71&& is evaluated before ||
- AVerdadero
- BFalso
72Decision control structures are for example:
- Aif-else
- Bswitch
- Cfor loop
- Dwhile loop
73Statement2 will only executed if the expression is true
if(boolean_expression)
statement1; statement2;- AVerdadero
- BFalso
74An if-part always needs an else-part.
- AVerdadero
- BFalso
75Where is/are the error(s)?
if(boolean_expression1){
statement1;}
elseif(boolean_expression2){
statement2;}
else{
statement3;}- Aa ";" is missing
- Bonly one boolean_expression is possible
- Celse if needs to be written like this
- Da bracket is missing
- Ethere is none
76Does this compile?
if(number = 1){
statement1;}
else{
statement2;}- Ayes, without restriction
- Byes, but it will always go into the if-part
- Cno, because the "=" is not comparing
- Dno, because the else-if-part is missing
77A switch-statement allows branching multiple outcomes.
- AVerdadero
- BFalso
78Every case in a switch-statement needs a "break" at the end.
- AVerdadero
- BFalso
79The more general cases in a switch-statement should be at the beginning.
- AVerdadero
- BFalso
80The default-part in a switch-statement is always necessary.
- AVerdadero
- BFalso
81Where is/are the error(s)?
switch( switch_expression ){
case case1:
statement1;
statement2;
break;
case case2:
statement1;
break;
}- Athe curly braces are missing
- Bthere are too many statements in case1
- Cthe default is missing
- Dthere is none
82The if-else and switch statement are similar because they make decisions based on a single value.
- AVerdadero
- BFalso
83Every java class is a subclass of java.lang.Object.
- AVerdadero
- BFalso
84All methods of the class java.util.ArrayList are synchronized.
- AVerdadero
- BFalso
85The class java.lang.Throwable hands directly down to
- Ajava.lang.Exceptions
- Bjava.lang.Error
- Cjava.lang.Mistake
86Packages are used for:
- Aconcentration of physical structure
- Bencapsulation
- Cconcentration of logical structure
87If a class has a natural order and needs to be sorted, you should use a Comparator object.
- AVerdadero
- BFalso
88The class String has immutable objects.
- AVerdadero
- BFalso
89It is advised to use the equals-method of StringBuffer objects because they are mutable.
- AVerdadero
- BFalso
90Every primitive type of data has a wrapper class.
- AVerdadero
- BFalso
Información
- Descripción
- Test sobre Java quiz, creado por Daniel Schwarz el 29/03/2018.
- Autor
- Daniel Schwarz
- Idioma
- English
- Visitas
- 8
- Valoración
- Aún sin valoraciones Valora este test