Java, SQL, and Component Programming Quiz

Test your knowledge of Java programming, SQL/PL/SQL database concepts, and component-based software engineering principles.

20 Questions Published

Questions

Question 1 True/False

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

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

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

  1. White-box
  2. Black-box
  3. Grey-box
  4. None
Question 3 Multiple Choice (Single Answer)

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
Question 4 Multiple Choice (Single Answer)

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
Question 5 Multiple Choice (Single Answer)

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
Question 6 Multiple Choice (Multiple Answers)

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
Question 7 Multiple Choice (Single Answer)

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
Question 8 Multiple Choice (Single Answer)

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
Question 9 Multiple Choice (Single Answer)

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

  1. Header
  2. Declarative
  3. Executable
  4. Exception
Question 10 Multiple Choice (Single Answer)

Select the VALID trigger type(s)?

  1. AFTER statement trigger
  2. INSERT row trigger
  3. DELETE row trigger
  4. All of the above
Question 11 Multiple Choice (Multiple Answers)

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
Question 12 Multiple Choice (Single Answer)

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
Question 13 Multiple Choice (Single Answer)

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

  1. TO_CHAR
  2. LOWER
  3. LPAD
  4. MAX
Question 14 Multiple Choice (Multiple Answers)

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

  1. Header
  2. Declarative
  3. Executable
  4. Exception
Question 15 Multiple Choice (Single Answer)

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
Question 16 Multiple Choice (Single Answer)

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
Question 17 Multiple Choice (Single Answer)

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.
Question 18 Multiple Choice (Single Answer)

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
Question 19 Multiple Choice (Single Answer)

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
Question 20 Multiple Choice (Single Answer)

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