0
Alien head

programming languages Online Quiz - 204

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

Given: class Circus { public static void main(String[] args) { int x = 9; int y = 6; for(int z = 0; z < 6; z++, y--) { if(x > 2) x--; label: if(x > 5) { System.out.print(x + " "}; --X; continue label; } X--; } } } What is the result?

  1. 8

  2. 8 7

  3. 8 7 6

  4. Compilation fails

  5. An exception is thrown at runtime


Correct Option: D

Given: class Plane { static String s = "-"; public static void main(String[] args) { new Plane().s1() ; System.out.println(s); } void sl() { try { s2(); catch (Exception e) { s += "c"; } } void s2() throws Exception { s3(); s += "2"; s3(); s += "2b"; } void s3() throws Exception { throw new Exception(); } } What is the result?

  1. -

  2. -c

  3. -c2

  4. -2c

  5. -c22b

  6. -2c2b


Correct Option: B

Given: 1. class Crivitch { 2. public static void main(String [] args) { 3. int x = 0; 4. // insert code here 5. do { } while (x++ < y); 6. System.out.println(x); 7. } 8. } Which, inserted at line 4, produces the output 12?

  1. int y = x;

  2. int y = 10;

  3. int y = 11;

  4. int y = 12;

  5. int y = 13;

  6. None of the above will allow compilation to succeed


Correct Option: C

Given the following code: public class OrtegorumFunction { public int computeDiscontinuous(int x) { int r = 1; r += X; if ((x > 4) && (x < 10)) { r += 2 * x; } else (x <= 4) { r += 3 * x; } else { r += 4 * x; } r += 5 * x; return r; } public static void main(String [] args) { OrtegorumFunction o = new OrtegorumFunction(); System.out.println("OF(11) is: " + o.computeDiscontinuous (11)); } } What is the result?

  1. OF(11) is: 45

  2. OF(11) is: 56

  3. OF(11) is: 89

  4. OF(11) is: 111

  5. Compilation fails

  6. An exception is thrown at runtime.


Correct Option: E

Which of the following SQL statements does count the rows in the 'Sales' table?

  1. SELECT COUNT(*) FROM Sales

  2. SELECT COUNT(*) IN Sales

  3. SELECT COUNTER(*) FROM Sales

  4. SELECT NUM() FROM Sales


Correct Option: A

Which of the following statements gets the total value of the column 'Price' in the 'Sales' table?

  1. SELECT ADD(Price) FROM Sales

  2. SELECT SUM(Price) WHERE Sales

  3. SELECT TOTAL(Price) FROM Sales

  4. SELECT SUM(Price) FROM Sales


Correct Option: D

Which section of a PL/SQL block would most likely contain a RAISE statement?

  1. Header

  2. Declarative

  3. Executable

  4. Exception


Correct Option: C,D

Which of the following SQL functions can operate on any datatype?

  1. TO_CHAR

  2. LOWER

  3. LPAD

  4. MAX


Correct Option: D

In a PL/SQL block, a variable is declared as NUMBER without an initial value. What will its value be when it is first used in the executable section of the PL/SQL block?

  1. NULL

  2. 0

  3. Results in a compilation error

  4. An exception will be raised


Correct Option: A

PL/SQL raises an exception, in which TWO of the following cases:

  1. When a SELECT statement returns no rows

  2. When a SELECT statement returns more than one row

  3. When the datatypes of SELECT clause and INTO clause do not match

  4. When INTO statement is missing in the SELECT statement


Correct Option: A,B

Select the VALID trigger type(s)?

  1. AFTER statement trigger

  2. INSERT row trigger

  3. DELETE row trigger

  4. All of the above


Correct Option: A

Functions for error trapping are contained in which section of a PL/SQL block?

  1. Header

  2. Declarative

  3. Executable

  4. Exception


Correct Option: D

The TRUNCATE TABLE…

  1. checks if the table has primary key specified

  2. Deletes the table

  3. deletes all rows from a table

  4. change the structure of the table


Correct Option: C

A trigger is…

  1. a special type of table

  2. a special type of store procedure, executed when certain event occurs

  3. a special type of view

  4. a dynamic procedure


Correct Option: B

Select the correct statements

  1. Component can exist outside workspace

  2. Dependencies can be defined between Components

  3. Component and Class are same entities

  4. Component can have Interfaces


Correct Option: B,D

DesignCompModeler is ready with his Model changes and now wants to share them with Other Components in that workspace, to do this, run

  1. Generate Code

  2. Fetch New Shared Model

  3. Release to Shared pool

  4. Track Model changes


Correct Option: C

is the process for determining the suitability of a Component for use within the intended final system.

  1. Adaptation

  2. Assembly

  3. Qualification

  4. Maintenance


Correct Option: C

When a Component is released to shared pool, Which of the following statements hold true.

  1. It becomes Obsolete

  2. It becomes Frozen

  3. It is still available for Modeling

  4. None of above


Correct Option: B

From external components or systems perspective, a component is a .

  1. White-box

  2. Black-box

  3. Grey-box

  4. None


Correct Option: B

Component A dependent on another Component B can access all Operations defined in B

  1. True

  2. False


Correct Option: B
+ View questions