KUNCI JAWABAN ALL QUIZ ORACLE ACADEMY DI ILEARNING ORACLE ACADEMY ALL SESSION

kumpulan kunci jawaban quiz ilearning oracle academy all session

KUNCI JAWABAN ALL QUIZ ORACLE ACADEMY DI ILEARNING ORACLE ACADEMY ALL SESSION - Pada artikel kali ini akan membahas tentang kumpulan kunci jawaban quiz ilearning oracle academy semua session, baik itu kunci jawaban quiz session 1 sampai dengan kunci jawaban quiz session 7. untuk lebih jelasnya, silahkan cari dan temukan kunci jawaban all quiz oracle academy di bawah ini.

The following code fragment properly implements the switch statement. True or false?

default(input)
switch '+':
answer+=num;
break;
case '-':
answer-=num;
break;
!default
System.out.println("Invalid input");

True
False (*)

What is the difference between the symbols = and == ?
The symbol = is used in if statements and == is used in loops
The symbol == is used to assign values to variables and the = is used in declarations.
The = is use to assign values to variables and the == compares values. (*)
There is no difference.

Determine whether this boolean expression evaluates to true or false:
!(3 < 4 && 5 > 6 || 6 <= 6 && 7 - 1 == 6)

True
False (*)

Which of the two diagrams below illustrate the correct syntax for variables used in an if-else statement?

Example A (*)
Example B

In Java, each case seqment of a switch statement requires the keyword break to avoid "falling through".
True (*)
False

switch statements work on all input types including, but not limited to, int, char, and String. True or false?
True
False (*)

Which of the following correctly initializes an instance of Scanner, called "in", that reads input from the console screen?
Scanner in = Scanner(System.in);
Scanner in = new Scanner("System.in");
Scanner in = new Scanner(System.in); (*)
System.in in = new Scanner();


In an if-else construct, the condition to be evaluated must be contained within parentheses. True or False?
True (*)
False

The syntax below represents a valid initialization of a for loop counter. True or False?

public class ForLoop {
 public static void main (String args[])
 {
  for (int i=10; i <20; i++)
  {System.out.println("i: "+i); }
 }
}

True (*)
False

Identify which situation could be an example of a while loop.

Taking coins out of a pile one at a time and adding their value to the total until there are no more coins in the pile to add.
Attending class while school is not over for the day.
Petting each animal at the pet store one at a time until all the animals have been petted.
All of the above. (*)

What is one significant difference between a while loop and a do-while loop?

There is no difference between a DO-WHILE loop and a WHILE loop.
A DO-WHILE loop does not exist in Java and a WHILE loop does.
A DO-WHILE loop will always execute the code at least once, even if the conditional statement for the WHILE is never true. A WHILE loop is only executed if the conditional statement is true. (*)
A DO-WHILE loop includes an int that serves as a counter and a WHILE loop does not.

Updating the input of a loop allows you to implement the code with the next element rather than repeating the code always with the same element. True or false?
True (*)
False

What is the output of the following code segment?

int num = 7;
while(num >= 0)
{
num -= 3;
}
System.out.println(num);

-2 (*)
1
2
0

What should replace the comment "//your answer here" in the code below if the code is meant to take no action when i % 2 is 0 (in other words when i is even)?

for(int i = 0; i < 10; i++){
if(i%2 == 0)
//your answer here
else
k+=3;
}

k+=1;
continue; (*)
return;
break;

A counter used in a for loop cannot be initialized within the For loop header. True or false?
True
False (*)

Which of the following would give you an array index out of bounds exception?

Refering to an element of an array that is at an index greater than the length of that array minus one. (*)
Misspelling a variable name somewhere in your code.
Refering to an element of an array that is at an index less than the length of the array minus one.
Unintentionally placing a semicolon directly after initializing a for loop.
Using a single equal symbol to compare the value of two integers.


Suppose you misspell a method name when you call it in your program. Which of the following explains why this gives you an exception?

Because the interpreter does not recognize this method since it was never initialized, the correct spelling of the method was initialized.
Because the parameters of the method were not met.
This will not give you an exception, it will give you an error when the program is compiled. (*)
Because the interpreter tries to read the method but when it finds the method you intended to use it crashes.

Which line of code shows the correct way to throw an exception?
new throw Exception("Array index is out of bounds");
throw Exception("Array index is out of bounds");
throw new Exception("Array index is out of bounds"); (*)
throws new Exception("Array index is out of bounds");

A logic error occurs if an unintentional semicolon is placed at the end of a loop initiation because the interpreter reads this as the only line inside the loop, a line that does nothing. Everything that follows the semicolon is interpreted as code outside of the loop. True or false?
True
False (*)



What do exceptions indicate in Java?
Exceptions do not indicate anything, their only function is to be thrown.

The code was not written to handle all possible conditions. (*)
The code has considered and dealt with all possible cases.
A mistake was made in your code. (*)


Which of the following declares a one dimensional array named names of size 8 so that all entries can be Strings?

String[] names=new String[8]; (*)
String[] name=String[8];
String names=new String[8];
String[] name=new Strings[8];







The following segment of code initializes a 2 dimensional array of references. True or false?

String[][] array={{"a", "b", "C"},{"a", "b", "c"}};

True (*)
False


What will be the content of the array variable table after executing the following code?

1 0 0
0 1 0
0 0 1


1 1 1
0 1 1
0 0 1


0 0 1
0 1 0
1 0 0


1 0 0
1 1 0
1 1 1 (*)


What is the output of the following segment of code?

555555
987654
777777 (*)
This code doesn't compile.
456789

Which of the following declares a one dimensional array name scores of type int that can hold 14 values?

int score= new int[14];
int scores;
int[] scores=new scores int[14];
int[] scores=new int[14]; (*)



Which of the following declares and initializes a one dimensional array named words of size 3 so that all entries can be Strings?

String strings=new String[3];
String[] words={"Over","the","mountain"}; (*)
String[] words={"Oracle","Academy"}];
String[] words=new String[3];

What is the output of the following segment of code?

int array[][] = {{1,2,3},{3,2,1}};
for(int i=0;i<2;i++)
for(int j=0;j<3;j++)
System.out.print(2*array[1][1]);


222222
This code doesn't compile.
444444 (*)
123321
246642



What will be the content of array variable table after executing the following code?

0 0 0
0 0 0
0 0 0

0 0 1
0 1 0
1 0 0

1 0 0
0 1 0
0 0 1 (*)

1 0 0
1 1 0
1 1 1



What will array arr contain after the following code segment has been executed?

int [] arr = {5, 4, 2, 1, 0};
for (int i = 1; i < arr.length; i++)
{
arr[i - 1] += arr[i];
}

10, 6, 3, 1, 0
9, 6, 1, 3, 0
9, 6, 3, 1, 0 (*)
7, 3, 2, 1, 0
None of the above.

The following segment of code prints all five of the command line arguments entered into this program. True or false?

True
False (*)


The following code creates an object of type Horse:
Whale a=new Whale();

True
False (*)


The constructor method must always have at least one parameter. True or false?

True
False (*)

A constructor is used to create objects. True or false?

True (*)
False


It is possible to overload a method that is not a constructor. True or False?
True (*)
False


Which of the following is the correct way to code a method with a return type an object Automobile?
Automobile upgrade(String carA){
carA="Turbo";
return carA;
}


Automobile upgrade(Automobile carA){
carA.setTurbo("yes");
return carA;
} (*)

String upgrade(String carA){
carA="Turbo";
return carA;
}

upgrade(Automobile carA) Automobile{
carA.setTurbo("yes");
return carA;
}

None of the above. It is not possible to return an object.


It is possible to have more than one constructor with the same name in a class, but they must have different parameters. True or false?
True (*)
False


Is there a difference between overriding a method and overloading a method?

No, they are the same.
Yes. Overriding allows for the creation of an array of different object types and overloading restricts an array to only contain the same object types.
Yes. Overriding is done within a single class and overloading is done through a series of superclasses and their subclasses.
Yes. Overriding is done in the subclass and allows for redefining a method inherited from the superclass and overloading is done within a class and allows for multiple methods with the same name. (*)


Which of the following can be declared final?

Classes
Methods
Local variables
Method parameters
All of the above (*)


What is the Java keyword final used for in a program?
It terminates the program.
There is no such keyword in Java.
It restricts a class from being extendable and restricts methods from being overridden. (*)
It permits access to the class variables and methods from anywhere.
It permits redefining methods of a parent class inside the child class, with the same name, parameters, and return type.


Static methods can't change any class variable values at run-time. True or false?
True
False (*)


You can create static class methods inside any Java class. True or false?
True (*)
False


Static methods can read static variables. True or false?
True (*)
False


Which of the following show the correct UML representation of the super class Planet and its subclass Earth?

According to the following class declaration, runSpeed can be modified in class Cat. True or false

public class Tiger extends Cat{
public int runSpeed;
}

True
False (*)

Which of the following correctly describes the use of the keyword super?

A keyword that allows subclasses to access methods, data, and constructors from their parent class. (*)
A keyword that allows access from anywhere.
A keyword that signals the end of a program.
A keyword that restricts access to only inside the same class.

Tag : Kunci Jawaban All Quiz Oracle Academy, Kumpulan Jawaban Ilearning Oracle Academy

No comments for "KUNCI JAWABAN ALL QUIZ ORACLE ACADEMY DI ILEARNING ORACLE ACADEMY ALL SESSION"