Vidyalelo
Java Programming · Q48

Strings

Programming · Java Programming · question 48

Q48

What will be the output? public class Test public static void main(String args[]) Object myObj = new String[]"one", "two", "three"; for(String s : (String[])myObj) System.out.print(s + ".");

A.
one.two.three.
Answer
B.
Compilation fails because of an error at line 3
C.
Compilation fails because of an error at line 5
D.
An exception is thrown at runtime.
E.
None of these

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board