0
Alien head

programming languages Online Quiz - 195

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

finalize method is used to release system resources.

  1. True

  2. False


Correct Option: A

main method can be final.

  1. True

  2. False


Correct Option: A

main method can be overloaded

  1. True

  2. False


Correct Option: A

Octal literals begin with 'O'

  1. True

  2. False


Correct Option: B

Even an empty file is a valid source file.

  1. True

  2. False


Correct Option: A

Comments can be nested.

  1. True

  2. False


Correct Option: B

Examine the structure of the EMPLOYEES table:EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2(25)LAST_NAME VARCHAR2(25)Which three statements insert a row into the table? (Choose three.)A. INSERT INTO employeesVALUES ( NULL, 'John', 'Smith');B. INSERT INTO employees( first_name, last_name)VALUES( 'John', 'Smith');C. INSERT INTO employeesVALUES ( '1000', 'John', NULL);D. INSERT INTO employees (first_name, last_name, employee_id)VALUES ( 1000, 'John', 'Smith');E. INSERT INTO employees (employee_id)VALUES (1000);F. INSERT INTO employees (employee_id, first_name, last_name)VALUES ( 1000, 'John', ' ');

  1. A

  2. C,E

  3. C,E,F

  4. None


Correct Option: C

package statictest; public class TestStaticVar { static int p =100; static void setP(int p) { this.p = p; System.out.print("p== "+p); } public static void main(String[] args) { setP(500); System.out.print("p=="+p); } }

  1. p== 500 p== 100

  2. Run time exception

  3. Compiler error

  4. p== 500 p== 500


Correct Option: C

package statictest; class TestStaticSub { static int p = 100; public static void printP() { System.out.println("P in parent class..." + p); } } public class TestStaticVariable extends TestStaticSub { public static void printP() { p = 200; System.out.println("P in sub class ..." + p); } public static void main(String[] args) { TestStaticSub tsv = new TestStaticVariable(); tsv.printP(); } }

  1. P in sub class ... 200

  2. Compiler error

  3. P in parent class...100

  4. Run time exception


Correct Option: C

package staticinit; public class TestStaticInit { { System.out.print("I am in Init "); } TestStaticInit() { System.out.print("Constructor. "); } static { System.out.print("I am in Static. "); } static { System.out.print("I am in Static1. "); } public static void main(String[] args) { } }

  1. No output

  2. I am in Static. I am in Static1.

  3. Run time exception

  4. Compiler error


Correct Option: B

package staticinit; public class TestStaticInit { { System.out.print("I am in Init "); } TestStaticInit() { System.out.print("Constructor "); } static { System.out.print("I am in Static "); } static { System.out.print("I am in Static1 "); } public static void main(String[] args) { System.out.println("Before calling "); TestStaticInit init = new TestStaticInit(); TestStaticInit init1 = new TestStaticInit(); } }

  1. I am in Static. I am in Static1. Before calling. I am in Init. Constructor. I am in Init. Constructor.

  2. Before calling. I am in Static. I am in Static1. I am in Init. Constructor. I am in Init.Constructor.

  3. Before calling. I am in Static. I am in Static1. Constructor. I am in Init. Constructor. I am in Init.

  4. Before calling. Constructor. I am in Static. I am in Static1. I am in Init. Constructor. I am in Init.


Correct Option: A

package statictest; public class TestStatic { public static void message() { System.out.println("In message"); } public static void main(String arg[]) { TestStatic a = null; a.message (); } }

  1. Null Pointer exception

  2. In message

  3. Compiler error

  4. No output


Correct Option: B

A method is defined in a class as : void processUser(int i) { } If this method is overriden in a sub class,_

  1. the new method should return int

  2. the new method can return any type of values

  3. the argument list of new method should exactly match that of overriden method

  4. the return type of new method should nottch that of overriden method


Correct Option: C

What is the output of following piece of code ? int x = 2; switch (x) { case 1:System.out.println(”1?); case 2: case 3:System.out.println(”3?); case 4: case 5:System.out.println(”5?); }

  1. No output

  2. 3 and 5

  3. 1, 3 and 5

  4. 3


Correct Option: B

Stateful Session beans contain

  1. Home Interface

  2. Remote Interface

  3. Bean Class

  4. All


Correct Option: D

Which is the data structure used to store sorted map elements ?

  1. HashSet

  2. Hashmap

  3. Map

  4. TreeMap


Correct Option: D

A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector

  1. The element will be successfully added

  2. ArrayIndexOutOfBounds Exception

  3. The Vector allocates space to accommodate up to 17 elements

  4. The element will be successfully deleted


Correct Option: A

Where do we store the temporary objects/sections

  1. Scratch Pad

  2. Library

  3. Class

  4. Parameters


Correct Option: A

Using which section do we implement the Parallel report

  1. Parallel Section

  2. Report Section

  3. Group Section

  4. Sequential section


Correct Option: A

Can we define global methods in a report

  1. True

  2. False


Correct Option: A
+ View questions