Tag: programming languages
Questions Related to programming languages
-
void run();
-
protected void go();
-
static void get();
-
public abstract set();
-
none of these
-
interface declares constant and instance variables.
-
The abstract modifier can be combined with the static modifier .
-
native modifier can be applied only on method.
-
synchronized modifier can be applied to method as well as class.
-
none of these
-
class cons{ cons() { } public void cons(); public static void main (String[] aa){ cons b=new cons(); } }
-
public class cons { cons() { } public cons(int x,int y) { System.out.print(x +" "+ y); } public static void main (String[] aa){ cons b=new cons(); cons obj=new cons(4,2); } }
-
public class cons { public cons(int x) { System.out.print(x); } public static void main (String[] aa){ cons b=new cons(); } }
-
class cons{ cons() { } public float foo () { double f = 32; return f; } public static void main (String[] aa){ cons b=new cons(); } }
-
Compilation error on line 1
-
Compilation error on line 2
-
Compilation error on line 3
-
Line 3 compiles fine
-
Prints 10 random numbers between 0 and 127
-
A static method may override another static method
-
A static method cannot override a non-static method
-
A non-static method cannot override a static method
-
A non-static method may be overloaded by a static method
-
A synchronized method cannot be overridden
-
The try-catch block that encloses myref.test(); is mandatory for the code to compile
-
Prints: In TechnoSample
-
Prints: In TechnoSampleSub
-
Method test() in class TechnoSampleSub has no obligation to declare a throws clause
-
An exception is thrown at runtime
-
Wrapper Type Call
-
Primitive Type Call
-
Compiler Error
-
Compiles fine, throws runtime exception
-
The program will not compile because the creation of bool4 object will cause compilation error.
-
The program will produce the output 'true false false'.
-
The program will produce the output 'true true true'.
-
The program will output 'true false true'.
-
The program won't compile.
-
The program will throw a run-time exception.
-
The program will output '31 100'
-
The program will output '31 99'
-
The program will raise a run-time exception telling that it is not possible to skip bytes in the middle of a reading operation.
-
The program will output 'd'.
-
The program will output 'e'.
-
The program will output 'g'.