0
Alien head

programming languages Online Quiz - 110

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

Which of the following options is true for the following program: try { if (choice) { while (true) } else { system .exit(1): } }finally { codetocleanup(); }

  1. Runtime Exception

  2. finally block will be executed

  3. finally block will not be executed

  4. Compilation error in else block


Correct Option: C

Program output : package com.collection.examples; import java.util.HashSet; public class HashSetExample { public static void main(String[] args) { HashSet s = new HashSet();//1 for(short i = 0; i<100;i++){ //2 s.add(i); //3 s.remove(i-1); //4 } System.out.println(s.size()); //5 } }

  1. NumberFormat Exception

  2. 100

  3. Compilation fails at line 4

  4. 99


Correct Option: B

What of the following fails to cause a thread stop executing ?

  1. The program exits via a call to System.exit(0);

  2. Another thread is given a higher priority.

  3. A call to the thread's stop method.

  4. A call to the halt method of the Thread class.


Correct Option: D

A monitor called nik has 3 threads, having same priority, in its waiting pool; How can we notify one of the threads, named 'thread1' to move from Waiting state to Ready State?

  1. Execute notify(thread1); from within synchronized code of mon.

  2. Execute mon.notify(thread1); from synchronized code of any object.

  3. Execute thread1.notify(); from synchronized code of any object.

  4. Execute thread1.notify(); from any code(synchronized or not) of any object.

  5. You cannot specify which thread will get notified.


Correct Option: E

What of the following fails to cause a thread stop executing ?

  1. The program exits via a call to System.exit(0);

  2. Another thread is given a higher priority.

  3. A call to the thread's stop method.

  4. A call to the halt method of the Thread class.


Correct Option: D

A monitor called nik has 3 threads, having same priority, in its waiting pool; How can we notify one of the threads, named 'thread1' to move from Waiting state to Ready

  1. Execute notify(thread1); from within synchronized code of mon.

  2. Execute mon.notify(thread1); from synchronized code of any object.

  3. Execute thread1.notify(); from synchronized code of any object.

  4. Execute thread1.notify(); from any code(synchronized or not) of any object.

  5. You cannot specify which thread will get notified.


Correct Option: E

The appropriate table to use when performing arithmetic calculations on values defined within the SELECT statement (not pulled from a table column) is

  1. EMP

  2. The table containing the column values

  3. DUAL

  4. An Oracle-defined table


Correct Option: C

Which of the following is not a group function?

  1. avg( )

  2. sqrt( )

  3. sum( )

  4. max( )


Correct Option: B

The default character for specifying runtime variables in SELECT statements is

  1. Ampersand

  2. Ellipses

  3. Quotation marks

  4. Asterisk


Correct Option: A

Which two of the following orders are used in ORDER BY clauses?

  1. ABS

  2. ASC

  3. DESC

  4. DISC


Correct Option: B,C

Which keyword is used in the select query to remove duplicates?

  1. Only

  2. NoDuplicate

  3. All

  4. Distinct


Correct Option: D

Single View can be created using multiple tables

  1. True

  2. False


Correct Option: A

Following SQL operator will allow duplicates

  1. UNION ALL

  2. UNION

  3. INTERSECT

  4. MINUS


Correct Option: A

You want to select all employee names starting with capital C. Which clause you will use?

  1. order by

  2. Like

  3. sameas

  4. not like


Correct Option: B

DELETE command will delete the table from database

  1. True

  2. False


Correct Option: A

UPDATE command is of following type

  1. Data Defenition Language

  2. Data Manipulation Language

  3. Data Updation Language

  4. Data Selection Language


Correct Option: B

We send and receive HTML file using which protocol?

  1. SMTP

  2. HTTP

  3. POP3

  4. FTP


Correct Option: B

Which sequence of HTML tags are correct?


Correct Option: B

What will extension for SSI?

  1. .shtml

  2. .html

  3. .htm

  4. .jsp


Correct Option: A

How we can include header and footer into our HTML page?

  1. Using SSI include

  2. Using JSP include

  3. Using Asp include

  4. All of the above


Correct Option: A
+ View questions