Java, SQL, and Component Programming Quiz
Test your knowledge of Java programming, SQL/PL/SQL database concepts, and component-based software engineering principles.
Questions
Component A dependent on another Component B can access all Operations defined in B
- True
- False
From external components or systems perspective, a component is a .
- White-box
- Black-box
- Grey-box
- None
When a Component is released to shared pool, Which of the following statements hold true.
- It becomes Obsolete
- It becomes Frozen
- It is still available for Modeling
- None of above
is the process for determining the suitability of a Component for use within the intended final system.
- Adaptation
- Assembly
- Qualification
- Maintenance
DesignCompModeler is ready with his Model changes and now wants to share them with Other Components in that workspace, to do this, run
- Generate Code
- Fetch New Shared Model
- Release to Shared pool
- Track Model changes
Select the correct statements
- Component can exist outside workspace
- Dependencies can be defined between Components
- Component and Class are same entities
- Component can have Interfaces
A trigger is…
- a special type of table
- a special type of store procedure, executed when certain event occurs
- a special type of view
- a dynamic procedure
The TRUNCATE TABLE…
- checks if the table has primary key specified
- Deletes the table
- deletes all rows from a table
- change the structure of the table
Functions for error trapping are contained in which section of a PL/SQL block?
- Header
- Declarative
- Executable
- Exception
Select the VALID trigger type(s)?
- AFTER statement trigger
- INSERT row trigger
- DELETE row trigger
- All of the above
PL/SQL raises an exception, in which TWO of the following cases:
- When a SELECT statement returns no rows
- When a SELECT statement returns more than one row
- When the datatypes of SELECT clause and INTO clause do not match
- When INTO statement is missing in the SELECT statement
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?
- NULL
- 0
- Results in a compilation error
- An exception will be raised
Which of the following SQL functions can operate on any datatype?
- TO_CHAR
- LOWER
- LPAD
- MAX
Which section of a PL/SQL block would most likely contain a RAISE statement?
- Header
- Declarative
- Executable
- Exception
Which of the following statements gets the total value of the column 'Price' in the 'Sales' table?
- SELECT ADD(Price) FROM Sales
- SELECT SUM(Price) WHERE Sales
- SELECT TOTAL(Price) FROM Sales
- SELECT SUM(Price) FROM Sales
Which of the following SQL statements does count the rows in the 'Sales' table?
- SELECT COUNT(*) FROM Sales
- SELECT COUNT(*) IN Sales
- SELECT COUNTER(*) FROM Sales
- SELECT NUM() FROM Sales
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?
- OF(11) is: 45
- OF(11) is: 56
- OF(11) is: 89
- OF(11) is: 111
- Compilation fails
- An exception is thrown at runtime.
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?
- int y = x;
- int y = 10;
- int y = 11;
- int y = 12;
- int y = 13;
- None of the above will allow compilation to succeed
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?
- -
- -c
- -c2
- -2c
- -c22b
- -2c2b
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?
- 8
- 8 7
- 8 7 6
- Compilation fails
- An exception is thrown at runtime