0

programming languages Online Quiz - 178

Description: programming languages Online Quiz - 178
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

Given: class CardBoard { Short story = 5; CardBoard go(CardBoard cb) { cb = null; return cb; } public static void main(String[] args) { CardBoard c1 = new CardBoard(); CardBoard c2 = new CardBoard(); CardBoard c3 = c1.go(c2); c1 = null; // do Stuff } } When // doStuff is reached, how many objects are eligible for GC?

  1. 0

  2. 1

  3. 2

  4. Compilation fails

  5. It is not possible to know

  6. An exception is thrown at runtime


Correct Option: C

Given: class Alien { String invade(short ships) { return "a few"; } String invade(short... ships) { return "many"; } } class Defender { public static void main(String [] args) { System.out.println(new Alien().invade(7)); } } What is the result?

  1. many

  2. a few

  3. Compilation fails

  4. The output is not predictable

  5. An exception is thrown at runtime


Correct Option: C

AI Explanation

To answer this question, we need to understand method overloading and method invocation in Java.

In the given code, there are two methods in the Alien class with the same name but different parameters: 1) String invade(short ships) 2) String invade(short... ships)

The first method takes a single short parameter, while the second method takes a variable number of short parameters.

In the Defender class, the main method creates a new instance of the Alien class and invokes the invade method with an argument of 7.

Since 7 is an integer literal, it is implicitly converted to a short before being passed as an argument to the invade method.

Now, the Java compiler tries to find the most specific method to invoke based on the argument passed. In this case, both methods can accept a short argument, so the method with a single short parameter is a more specific match.

However, when there are multiple methods with the same name and same specificity of match, the Java compiler gives priority to methods without varargs. In this case, the method with varargs is considered less specific.

Hence, the compiler fails because it cannot determine which invade method to invoke, resulting in a compilation error.

Therefore, the correct answer is option C) Compilation fails.

Given: 1. class Dims { 2. public static void main(String[] args) { 3. int[] [] a = {{1,2,}, {3,4}}; 4. int[] b = (int []) a [1] ; 5. Object o1 = a; 6. int[] [] a2 = (int[] []) o1; 7. int[] b2 = (int []) o1; 8. System.out.println(b[1]); 9. } } What is the result?

  1. 2

  2. 4

  3. An exception is thrown at runtime

  4. Compilation fails due to an error on line 4

  5. Compilation fails due to an error on line 5

  6. Compilation fails due to an error on line 6


Correct Option: C

AI Explanation

To answer this question, we need to analyze the given code step by step:

  1. The code declares a class Dims and defines a main method.
  2. Inside the main method:
    • Line 3 initializes a 2D array a with two rows and two columns.
    • Line 4 assigns the second row of array a to a 1D array b.
    • Line 5 assigns array a to an Object reference o1.
    • Line 6 attempts to cast o1 to a 2D array a2 (which is the original type of a).
    • Line 7 attempts to cast o1 to a 1D array b2 (which is the original type of b).
    • Line 8 prints the value at index 1 of array b.
  3. The code does not contain any compilation errors.

Now let's go through each option to determine the correct result:

Option A) 2 - This is not the correct result because the value at index 1 of array b is 4, not 2.

Option B) 4 - This is not the correct result because the value at index 1 of array b is 4, not 2.

Option C) An exception is thrown at runtime - This is the correct result. The code attempts to cast o1 to a 1D array b2 on line 7, but o1 refers to a 2D array a and cannot be cast to a 1D array. This will result in a ClassCastException being thrown at runtime.

Option D) Compilation fails due to an error on line 4 - This is not the correct result. Line 4 does not have any compilation errors. It successfully assigns the second row of array a to array b.

Option E) Compilation fails due to an error on line 5 - This is not the correct result. Line 5 does not have any compilation errors. It successfully assigns array a to the Object reference o1.

Option F) Compilation fails due to an error on line 6 - This is not the correct result. Line 6 does not have any compilation errors. It successfully casts o1 to a 2D array a2.

Therefore, the correct answer is C. An exception is thrown at runtime.

Given: class Eggs { int doX(Long x, Long y) { return 1; } int doX(long... x) { return 2; } int doX(Integer x, Integer y) { return 3; } int doX(Number n, Number m) { return 4; } public static void main(String[] args) { new Eggs().go(); } void go () { short s = 7; System.out.print(doX(s,s) + " "); System.out.println(doX(7,7)); } }

  1. 1 1

  2. 2 1

  3. 3 1

  4. 4 1

  5. 3 3

  6. 4 3


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) 1 1 - This option is incorrect because the first call to doX passes two short values (s), and the method with parameters Integer x, Integer y is not applicable. The second call to doX passes two int values (7), and the method with parameters int doX(long... x) is not applicable. Therefore, the output is not 1 1.

Option B) 2 1 - This option is incorrect because the first call to doX passes two short values (s), and the method with parameters Integer x, Integer y is not applicable. The second call to doX passes two int values (7), and the method with parameters int doX(long... x) is not applicable. Therefore, the output is not 2 1.

Option C) 3 1 - This option is correct. The first call to doX passes two short values (s), and the method with parameters int doX(Number n, Number m) is applicable because short is widened to int, and Number is a superclass of Integer. Therefore, the output is 3. The second call to doX passes two int values (7), and the method with parameters int doX(long... x) is applicable because int can be autoboxed to long. Therefore, the output is 1. The overall output is 3 1.

Option D) 4 1 - This option is incorrect because the first call to doX passes two short values (s), and the method with parameters Integer x, Integer y is not applicable. The second call to doX passes two int values (7), and the method with parameters int doX(long... x) is not applicable. Therefore, the output is not 4 1.

Option E) 3 3 - This option is incorrect because the first call to doX passes two short values (s), and the method with parameters int doX(Number n, Number m) is applicable because short is widened to int, and Number is a superclass of Integer. Therefore, the output is 3. The second call to doX also passes two int values (7), but it does not match any of the available methods. Therefore, the output is not 3 3.

Option F) 4 3 - This option is incorrect because the first call to doX passes two short values (s), and the method with parameters int doX(Number n, Number m) is applicable because short is widened to int, and Number is a superclass of Integer. Therefore, the output is 3. The second call to doX also passes two int values (7), but it does not match any of the available methods. Therefore, the output is not 4 3.

The correct answer is Option C) 3 1. This option is correct because the first call to doX is resolved to the method int doX(Number n, Number m), and the second call to doX is resolved to the method int doX(long... x).

Which is true? (Choose all that apply.)

  1. The invocation of an object's finalize() method is always the last thing that happens before an object is garbage collected (GCed).

  2. When a stack variable goes out of scope it is eligible for GC.

  3. Some reference variables live on the stack, and some live on the heap.

  4. Only objects that have no reference variables referring to them can be eligible for GC.

  5. It's possible to request the GC via methods in either java. lang. Runtime or java.lang.System classes.


Correct Option: C,E

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) The invocation of an object's finalize() method is always the last thing that happens before an object is garbage collected (GCed).

This option is incorrect because the finalize() method is not guaranteed to be the last thing that happens before an object is garbage collected. The finalize() method is called by the garbage collector before reclaiming the memory occupied by the object, but the exact timing of when it is called is not specified.

Option B) When a stack variable goes out of scope, it is eligible for GC.

This option is incorrect. Stack variables are automatically deallocated when they go out of scope, but they are not eligible for garbage collection because they are not allocated on the heap. Stack variables are managed by the compiler and deallocated automatically when they go out of scope.

Option C) Some reference variables live on the stack, and some live on the heap.

This option is correct. In Java, reference variables can live on both the stack and the heap. The stack holds local variables and method parameters, while the heap holds objects. Reference variables on the stack store memory addresses pointing to objects on the heap.

Option D) Only objects that have no reference variables referring to them can be eligible for GC.

This option is incorrect. Objects can be eligible for garbage collection even if they have reference variables referring to them, as long as those reference variables are not reachable. The garbage collector determines an object's eligibility for garbage collection based on whether it can be reached through a chain of reference variables from a root object.

Option E) It's possible to request the GC via methods in either java.lang.Runtime or java.lang.System classes.

This option is correct. In Java, you can request garbage collection explicitly using methods provided by the java.lang.Runtime or java.lang.System classes. The System.gc() or Runtime.getRuntime().gc() methods can be used to suggest that the garbage collector should run, but it is ultimately up to the JVM to decide whether to perform garbage collection.

The correct answer is C) Some reference variables live on the stack, and some live on the heap, and E) It's possible to request the GC via methods in either java.lang.Runtime or java.lang.System classes.

Given: 1. class Convert { 2. public static void main(String[] args) { 3. Long xL = new Long(456L); 4. long x1 = Long.valueOf("123"); 5. Long x2 = Long.valueOf("123"); 6. long x3 = xL.longValue(); 7. Long x4 = xL.longValue(); 8. Long x5 = Long.parseLong("456"); 9. long x6 = Long.parseLong("123"); 10. } 11. } Which will compile using Java 5, but will NOT compile using Java 1.4? (Choose all that apply.)

  1. Line 4

  2. Line 5

  3. Line 6

  4. Line 7

  5. Line 8

  6. Line 9


Correct Option: A,D,E

Given: 1. class Bigger { 2. public static void main(String[] args) { 3. // insert code here 4. } 5. } 6. class Better { 7. enum Faster {Higher, Longer}; 8. } Which, inserted independently at line 3, will compile? (Choose all that apply.)

  1. Faster f = Faster.Higher;

  2. Faster f = Better.Faster.Higher;

  3. Better.Faster f = Better.Faster.Higher;

  4. Bigger.Faster f = Bigger.Faster.Higher;

  5. Better. Faster f2; f2 = Better.Faster.Longer;

  6. Better b; b.Faster = f3; f3 = Better.Faster.Longer;


Correct Option: C,E

AI Explanation

To answer this question, let's go through each option to understand whether it will compile or not:

Option A) Faster f = Faster.Higher; This option will not compile because the enum Faster is defined inside the class Better, so it cannot be accessed directly without specifying the class name.

Option B) Faster f = Better.Faster.Higher; This option will not compile because the enum Faster is defined inside the class Better, and it cannot be accessed directly without specifying the class name.

Option C) Better.Faster f = Better.Faster.Higher; This option will compile because it correctly specifies the enum Faster and assigns one of its values (Higher) to the variable f.

Option D) Bigger.Faster f = Bigger.Faster.Higher; This option will not compile because the enum Faster is not defined inside the class Bigger. It is defined inside the class Better.

Option E) Better. Faster f2; f2 = Better.Faster.Longer; This option will compile because it declares a variable f2 of type Better.Faster and assigns one of its values (Longer) to f2 in a separate statement.

Option F) Better b; b.Faster = f3; f3 = Better.Faster.Longer; This option will not compile because it tries to assign a value to a non-existent variable b.Faster. Additionally, the variable f3 is not declared before it is used.

The correct answers are C and E. These options will compile as they correctly access the enum Faster and assign its values to variables.

Given: 1. class Example { 2. public static void main(String[] args) { 3. Short s = 15; 4. Boolean b; 5. // insert code here 6. } 7. } Which, inserted independently at line 5, will compile? (Choose all that apply.)

  1. b = (Number instanceof s);

  2. b = (s instanceof Short);

  3. b = s.instanceof(Short);

  4. b = (s instanceof Number);

  5. b = s.instanceof(Object);

  6. b = (s instanceof String);


Correct Option: B,D

AI Explanation

To determine which options will compile when inserted at line 5, let's go through each option:

Option A) b = (Number instanceof s); This option will not compile because the syntax is incorrect. The correct syntax for the instanceof operator is variable instanceof Class.

Option B) b = (s instanceof Short); This option will compile because it uses the correct syntax for the instanceof operator. It checks if the variable s is an instance of the Short class.

Option C) b = s.instanceof(Short); This option will not compile because the syntax is incorrect. The instanceof operator should be used with the variable on the left side.

Option D) b = (s instanceof Number); This option will compile because it uses the correct syntax for the instanceof operator. It checks if the variable s is an instance of the Number class.

Option E) b = s.instanceof(Object); This option will compile because it uses the correct syntax for the instanceof operator. It checks if the variable s is an instance of the Object class.

Option F) b = (s instanceof String); This option will not compile because it uses the incorrect class name. The variable s is declared as a Short, so it cannot be an instance of the String class.

Therefore, the options that will compile when inserted at line 5 are B) b = (s instanceof Short); and D) b = (s instanceof Number);.

Given: class Mixer { Mixer() { } Mixer(Mixer m) { ml = m;} Mixer m1; public static void main(String[] args) { Mixer m2 = new Mixer(); Mixer m3 = new Mixer(m2); m3.go(); Mixer m4 = m3.m1; m4.go(); Mixer m5 = m2.m1; m5.go(); } void go() { System.out.print("hi "); } } What is the result?

  1. hi

  2. hi hi

  3. hi hi hi

  4. Compilation fails

  5. hi, followed by an exception

  6. hi hi, followed by an exception


Correct Option: F

AI Explanation

To answer this question, let's go through each line of the code:

  1. In the Mixer class, there are two constructors:

    • Mixer() - This is a default constructor that does not take any arguments.
    • Mixer(Mixer m) - This constructor takes a Mixer object as an argument and assigns it to the instance variable ml.
  2. Inside the main method:

    • Mixer m2 = new Mixer(); - This creates a new Mixer object called m2 using the default constructor.
    • Mixer m3 = new Mixer(m2); - This creates a new Mixer object called m3 using the constructor that takes a Mixer object as an argument. The argument m2 is passed to this constructor.
    • m3.go(); - This calls the go() method on m3, which prints "hi ".
    • Mixer m4 = m3.m1; - This assigns the value of m3.m1 (which is null because it has not been initialized) to m4.
    • m4.go(); - This calls the go() method on m4, which also prints "hi ".
    • Mixer m5 = m2.m1; - This assigns the value of m2.m1 (which is null because it has not been initialized) to m5.
    • m5.go(); - This calls the go() method on m5, which also prints "hi ".

The output of the code will be: "hi hi ".

Therefore, the correct answer is F) "hi hi, followed by an exception".

Given: 1. class Zippy { 2. String[] x; 3. int[] a [] = {{1,2}, {l}}; 4. Object c = new long [4] ; 5. Object[] d = x; 6. } What is the result?

  1. Compilation succeeds.

  2. Compilation fails due only to an error on line 3

  3. Compilation fails due only to an error on line 4

  4. Compilation fails due only to an error on line 5

  5. Compilation fails due to errors on lines 3 and 5

  6. Compilation fails due to errors on lines 3, 4, and 5


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Compilation succeeds - This option is correct because there are no syntax errors in the code provided.

Option B) Compilation fails due only to an error on line 3 - This option is incorrect. Line 3 initializes a two-dimensional int array a[][] with values {{1,2}, {l}}. The l is likely a typo and should be replaced with a valid integer value. However, this error does not cause compilation to fail.

Option C) Compilation fails due only to an error on line 4 - This option is incorrect. Line 4 declares an Object variable c and initializes it with a long array. This is a valid assignment, and compilation does not fail due to this line.

Option D) Compilation fails due only to an error on line 5 - This option is incorrect. Line 5 declares an Object array d and assigns it the value of x, which is a String array. This is a valid assignment, and compilation does not fail due to this line.

Option E) Compilation fails due to errors on lines 3 and 5 - This option is incorrect. As explained above, the errors on lines 3 and 5 do not cause compilation to fail.

Option F) Compilation fails due to errors on lines 3, 4, and 5 - This option is incorrect. As explained above, the errors on lines 3, 4, and 5 do not cause compilation to fail.

The correct answer is A) Compilation succeeds. This option is correct because there are no syntax errors in the provided code.

Given: class Fizz { int x = 5; public static void main(String[] args) { final Fizz f1 = new Fizz(); Fizz f2 = new Fizz(); Fizz f3 = FizzSwitch(f1,f2); System.out.println((f1 == f3) + " " + (f1.x == f3.x)); } static Fizz FizzSwitch(Fizz x, Fizz y) { final Fizz z = x; z.x = 6; return z; } } What is the result?

  1. true true

  2. false true

  3. true false

  4. false false

  5. Compilation fails.

  6. An exception is thrown at runtime


Correct Option: A
Explanation:

Explanation: Let's go through the code step by step to understand the result.

  1. We have a class called "Fizz" with an instance variable "x" initialized to 5.

  2. In the main method, we create two instances of the "Fizz" class - f1 and f2.

  3. We then call the static method "FizzSwitch" passing f1 and f2 as arguments. In this method, we declare a final variable "z" and assign it the value of "x" (which is f1).

  4. Next, we modify the value of "x" using the "z" reference. Therefore, the value of "x" in f1 is changed to 6.

  5. Finally, we return the reference "z" (which is f1) and assign it to the variable "f3".

  6. In the println statement, we compare if f1 and f3 are the same object reference (f1 == f3) and if their instance variable "x" is the same (f1.x == f3.x).

Now let's analyze the options:

Option A) true true - This option is correct because f1 and f3 refer to the same object, and the value of "x" in both objects is 6.

Option B) false true - This option is incorrect because f1 and f3 refer to the same object, so f1 == f3 should be true.

Option C) true false - This option is incorrect because f1 and f3 refer to the same object, so f1 == f3 should be true.

Option D) false false - This option is incorrect because f1 and f3 refer to the same object, so f1 == f3 should be true.

Option E) Compilation fails - The code does not have any compilation errors, so this option is incorrect.

Option F) An exception is thrown at runtime - The code does not have any exceptional behavior, so this option is incorrect.

The correct answer is option A) true true. This option is correct because f1 and f3 refer to the same object, and the value of "x" in both objects is 6.

Therefore, the result of the code is "true true".

The correct answer is option A.

Given: class Knowing { static final long tooth = 343L; static long doIt(long tooth) { System.out.print(++tooth + " "); return ++tooth; } public static void main(String[] args) { System.out.print(tooth + " "); final long tooth = 340L; new Knowing().doIt(tooth); System.out.println(tooth); } } What is the result?

  1. 343 340 340

  2. 343 340 342

  3. 343 341 342

  4. 343 341 340

  5. Compilation fails.

  6. An exception is thrown at runtime


Correct Option: D

AI Explanation

To answer this question, let's go through the code step by step:

  1. The class "Knowing" is defined, and it has a static final long variable named "tooth" with a value of 343L.

  2. The method "doIt" is defined, which takes a long parameter named "tooth". Inside the method, the value of "tooth" is incremented by one using the prefix increment operator (++tooth). Then, the incremented value of "tooth" is printed.

  3. In the main method, the value of the static final variable "tooth" is printed, which is 343.

  4. A new long variable named "tooth" is declared and initialized with a value of 340L. This variable is local to the main method and shadows the static final variable "tooth" defined in the class.

  5. The "doIt" method is called with the local variable "tooth" as an argument. Inside the method, the value of "tooth" is incremented again and printed.

  6. Finally, the value of the local variable "tooth" is printed again, which is still 340.

Now let's analyze the options:

Option A) 343 340 340 - This option is incorrect because the value of the local variable "tooth" is incremented inside the "doIt" method.

Option B) 343 340 342 - This option is incorrect because the value of the local variable "tooth" is not incremented before it is printed.

Option C) 343 341 342 - This option is incorrect because the value of the local variable "tooth" is not incremented before it is printed.

Option D) 343 341 340 - This option is correct because the value of the local variable "tooth" is incremented inside the "doIt" method, resulting in the output 343 341 340.

Option E) Compilation fails - This option is incorrect because there are no compilation errors in the code.

Option F) An exception is thrown at runtime - This option is incorrect because the code does not throw any exceptions.

Therefore, the correct answer is D) 343 341 340.

Given: 1. class Eco { 2. public static void main(String[] args) { 3. Eco e1 = new Eco(); 4. Eco e2 = new Eco(); 5. Eco e3 = new Eco(); 6. e3.e = e2; 7. e1.e = e3; 8. e2 = null; 9. e3 = null; 10. e2.e = el; 11. e1 = null; 12. } 13. Eco e; 14. } At what point is only a single object eligible for GC?

  1. After line 8 runs

  2. After line 9 runs.

  3. After line 10 runs.

  4. After line 11 runs.

  5. An exception is thrown at runtime.

  6. Never in this program


Correct Option: E

AI Explanation

To determine when a single object becomes eligible for garbage collection (GC), we need to understand the concept of object references and the conditions for GC.

In this program, the class Eco has a reference variable e of type Eco. The main method creates three instances of the Eco class: e1, e2, and e3.

Let's go through each line of the code and analyze the changes:

  1. Eco e; - Declares a reference variable e without initializing it.
  2. Eco e1 = new Eco(); - Creates a new object of the Eco class and assigns its reference to e1.
  3. Eco e2 = new Eco(); - Creates a new object of the Eco class and assigns its reference to e2.
  4. Eco e3 = new Eco(); - Creates a new object of the Eco class and assigns its reference to e3.
  5. e3.e = e2; - Assigns the reference of e2 to the instance variable e of the e3 object. This creates a circular reference between e2 and e3.
  6. e1.e = e3; - Assigns the reference of e3 to the instance variable e of the e1 object.
  7. e2 = null; - Sets the e2 reference variable to null. This means that the object originally referenced by e2 is no longer accessible.
  8. e3 = null; - Sets the e3 reference variable to null. This means that the object originally referenced by e3 is no longer accessible.
  9. e2.e = el; - Throws a NullPointerException. Since e2 is null, trying to access e2.e results in an exception.
  10. e1 = null; - Sets the e1 reference variable to null. This means that the object originally referenced by e1 is no longer accessible.

Based on the code execution, let's analyze when each object becomes eligible for GC:

  1. e1 becomes eligible for GC after line 11 runs because the reference to the object is set to null.
  2. e2 becomes eligible for GC after line 8 runs because the reference to the object is set to null.
  3. e3 becomes eligible for GC after line 9 runs because the reference to the object is set to null.
  4. The object referenced by e2 becomes eligible for GC after line 10 runs because it is no longer accessible.

Therefore, at the end of the program, there is no object left that is eligible for GC. Hence, the correct answer is F. Never in this program.

The given correct answer, E. An exception is thrown at runtime, is incorrect because the exception is thrown before any object becomes eligible for GC.

Given:class Clidder { private final void flipper() { System.out.print(" Flip a Clidder"); }}public class Clidlet extends Clidder { public final void flipper() { System.out.print(" Flip a Clidlet"); } public static void main(String [] args) { new Clidlet().flipper(); }}What is the result?

  1. Flip a Clidlet

  2. Flip a Clidder

  3. Flip a Clidlet Flip a Clidder

  4. Flip a Clidder Flip a Clidlet

  5. Compilation fails.


Correct Option: A

Given: 1. class Comp2 { 2. public static void main(String[] args) { 3. float f1 = 2.3f; 4. float[][] f2 = {{42.Of}, {l.7f, 2.3f}, {2.6f, 2.7f}}; 5. float[] f3 = {2.7f}; 6. Long x = 42L; 7. // insert code here 8. System.out.println("true"); 9. } 10. } And the following five code fragments: F1. if (f1 == f2) F2. if (f1 == f2[2][1]) F3. if (x == f2[0][0]) F4. if (f1 == f2 [1,1]) F5. if (f3 == f2 [2]) What is true?

  1. One of them will compile, only one will be true.

  2. Two of them will compile, only one will be true.

  3. Two of them will compile, two will be true.

  4. Three of them will compile, only one will be true

  5. Three of them will compile, exactly two will be true.

  6. Three of them will compile, exactly three will be true.


Correct Option: D

Given: public class MyOuter { public static class MyInner { public static void foot) { } } } Which, if placed in a class other than MyOuter or MyInner, instantiates an instance of the nested class?

  1. MyOuter.MyInner m = new MyOuter.Mylnner();

  2. MyOuter.MyInner mi = new MyInner();

  3. MyOuter m = new Myouter(); MyOuter.MyInner mi = m.new Myouter.MyInner();

  4. MyInner mi = new MyOuter.MyInner();


Correct Option: A

Given: public class Foo { Foo() {System.out.print("foo");} class Bar{ Bar() {System.out.print("bar");} public void go() {System.out.print("hi");} } public static void main(String[] args) { Foo f = new Foo (); f.makeBar(); } void makeBar() { (new Bar() {}).go(); } } What is the result?

  1. Compilation fails.

  2. An error occurs at runtime.

  3. foobarhi

  4. barhi

  5. hi

  6. foohi


Correct Option: C

package loop; public class TestLoop5 { public static void main(String[] args) { for(;;) { System.out.println("I am in for loop"); } } }

  1. I am in for loop

  2. Infinite Loop

  3. Compiler Error

  4. Exception


Correct Option: B
- Hide questions