What will be the output of the program?


			  		

Loading

Practice Language Fundamentals –

What will be the output of the program?

public class CommandArgsThree {     
public static void main(String [] args) {
String [][] argCopy = new String[2][2];
int x;
argCopy[0] = args;
x = argCopy[0].length;
for (int y = 0; y < x; y++) {
System.out.print(" " + argCopy[0][y]);
}
}
}

and the command-line invocation is

java CommandArgsThree 1 2 3

A variable defined within a block is visible.

Loading

Practice Language Fundamentals –

A variable defined within a block is visible.

What will be the output of the program?


			  		

Loading

Practice Language Fundamentals –

What will be the output of the program?

import java.util.*;  
class H {
public static void main (String[] args) {
Object x = new Vector().elements();
System.out.print((x instanceof Enumeration)+",");
System.out.print((x instanceof Iterator)+",");
System.out.print(x instanceof ListIterator);
}
}

 

Which of the following is true in Java?

Loading

Practice Language Fundamentals –

Which of the following is true in Java?

Which of the following is true in Java?

Loading

Practice Language Fundamentals –

Which of the following is true in Java?

What will be the output of the program?

String s = "A

Loading

Practice Language Fundamentals –

What will be the output of the program?

String s = "ABC";  
s.toLowerCase();
s += "def";
System.out.println(s);

What will be the output of the program?


			  		

Loading

Practice Language Fundamentals –

What will be the output of the program?

class Q207  {      
public static void main(String[] args) {
int i1 = 5;
int i2 = 6;
String s1 = "7";
System.out.println(i1 + i2 + s1); /* Line 8 */
}
}

 

What will be the output of the program?


			  		

Loading

Practice Language Fundamentals –

What will be the output of the program?

public class Test178  {     
public static void main(String[] args) {
String s = "foo";
Object o = (Object)s;
if (s.equals(o)) {
System.out.print("AAA");
}
else {
System.out.print("BBB");
}
if(o.equals(s)) {
System.out.print("CCC");
}
else {
System.out.print("DDD");
}
}
}

 

What will be the output of the program?

String x = ne

Loading

Practice Language Fundamentals –

What will be the output of the program?

String x = new String("xyz"); 
String y = "abc";
x = x + y;

How many String objects have been created?