class main_arguments { public static void main(String [ ] args) { String [][] argument = new String[2][2]; int x; argument[0] = args; x = argument[0].length; for (int y = 0; y < x; y++) System.out.print(" " + argument[0][y]); } }
1 1
1 0
1 0 3
1 2 3
Q.2.
Which of the following best describes JavaScript?
a scripting language precompiled in the browser.
an object-oriented scripting language
a low-level programming language.
a compiled scripting language.
Q.3.
Which of the following statements are equal for a variable declared in the interface ?
1. int X=10 2. public int X=10 3. public static final int X=10
Only 1 and 2 are equal
Only 2 and 3 are equal
All are unequal
All are equal
Q.4.
How many of the following will follow JavaBean Listener naming rules?
addListener
addMouseListener
deleteMouseListener
removeMouseListener
registerMouseListener
1
2
3
4
Q.5.
X implements Y, Z
Arguments:
1. X should be class 2. Y, Z should be interfaces
Only 1 is true
Only 2 is true
Both 1 and 2 are true
None
Q.6.
Which of these class have only one field 'TYPE' ?
Run time
Process
Void
System
Q.7.
Convert the expression ((A + B) * C – (D – E) ^ (F + G)) to equivalent Postfix notations.
AC + B * DE - FG +^-
AB + C * DE - FG + ^-
AC + B* DE - FG -+ ^
AB + C * DE - FG -+ ^
Q.8.
Inside an interface when should the variables be initialized?
Globally
Whenever required
Inside a function
During the time of declaration
Q.9.
Which of the following method declarations are allowed inside interface?
public void m1()
private void m1()
protected void m1()
abstract public void m1()
Q.10.
Which of the following are valied?
A class can extend any number of classes simulteneously
A class can implement only one interface at a time
A class can extend other class or can implement interface but not both simulteneously
None of the above
Q.11.
try { int x = Integer.parseInt("two"); }
Which could be used to create an appropriate catch block?
ClassCastException
IllegalStateException
NumberFormatException
None
Q.12.
Which of the following is not a keyword?
assert
pass
eval
nonlocal
Q.13.
class Hell {
public static void main(String[] args) {
Integer i = 42;
String s = (i<40)?"life":(i>50)?"base":"ball";
System.out.println(s);
}
}
null
ball
base
None
Q.14.
Javascript is interpreted by
Server
Object
Client
None of the above
Q.15.
What is the string contained in s after following lines of code?
StringBuffer s = new StringBuffer(“Hello”); s.deleteCharAt(0); ?
llo
Hllo
ello
H
Q.16.
public class Threads2 implements Runnable {
public void run() {
System.out.println("run.");
throw new RuntimeException("Problem");
Which among the following is true?
}
public static void main(String[] args) {
Thread t = new Thread(new Threads2());
t.start();
System.out.println("End of method.");
}
}
java.lang.RuntimeException: Problem
run. java.lang.RuntimeException: Problem
End of method. java.lang.RuntimeException: Problem
End of method. run. java.lang.RuntimeException: Problem
Support mcqgeeks.com by disabling your adblocker.
Please disable the adBlock and continue. Thank you.