Oracle/C++/HTML Test Questions

1)   From the following which of the statement is true

a. Any procedure cannot raise an error and return a system message and error number
b. Error numbers ranging from 20000 to 20999 are system defined error messages
c. Oracle checks uniqueness of user defined messages
d. The Raise_Application_Error is used for raising user defined error messages.
Answer  Explanation 

ANSWER: The Raise_Application_Error is used for raising user defined error messages.

Explanation:
The Raise_Application_Error is used when the user wants to raise an error in the application. It is usually used when a user wants user defined error message.


2)   Can a database trigger be enabled or disabled?


a. Yes
b. No


Answer  Explanation 

ANSWER: Yes

Explanation:
The triggers can be enabled or disabled by using the syntax enable trigger trigger_name on table_name; or disable trigger trigger_name on table_name;


3)   When does a transaction end?

a. When it is committed or rolled back
b. Only when it is committed
c. Only when it is rolled back
d. None of the above
Answer  Explanation 

ANSWER: When it is committed or rolled back

Explanation:
Committed means a transaction is saved and rollback means a transaction comes to a where it was committed the last time. So when either is done we say that a transaction is ended.


4)   Can we modify a data type of a column which contains data in it?

a. Yes
b. No


Answer  Explanation 

ANSWER: No

Explanation:
Whenever a column has a data in it and we try to modify the data type of the column we cannot modify it if it has some data in it. Once the data is removed we can modify the column.


5)   How would you pass a value from one form to another?


a. LOV
b. Parameters
c. Local variables
d. Global variables
Answer  Explanation 

ANSWER: Local variables

Explanation:
Once a local variable is declared that can be used on the other forms also.


6)   Which of the following is the correct way of declaring an array?

a. array(5)
b. int array[10]
c. int array{5}
d. array{10}
Answer  Explanation 

ANSWER: int array[10]

Explanation:
This is the correct way as the values have to be declared only after the datatype.


7)   Explain the concept of data hiding

a. It is related with the data types
b. It is related to the classes
c. It is related with hiding internal object details
d. It is related with showing internal object details
Answer  Explanation 

ANSWER: It is related with hiding internal object details

Explanation:
It is a technique where specifically used in OOP to hide internal object details.


8)   By using what from the following can we define member function outside the class?

a. Using structures
b. Using pointers
c. Using union
d. Using scope resolution
Answer  Explanation 

ANSWER: Using scope resolution

Explanation:
Scope resolution operator is used to define a function outside the class or when we want to use a global variable but also has a local variable with the same name.


9)   What does operator overloading mean?


a. making new c++ operators
b. giving new meaning to existing c++ operators
c. giving c++ more than what they can handle
d. making c++ work with objects
Answer  Explanation 

ANSWER: giving new meaning to existing c++ operators

Explanation:
An overloaded declaration is a declaration that had been declared with the same name as a previously declared declaration in the same scope, except that both declarations have different arguments and obviously different definition (implementation).


10)   Predict the output for the following program
#include< iostream>

                using namesp std;
       class B1 {
public:
B1()
{ cout << " B1's constructor called" << endl; }
};

class B2 {
public:
B2()
{ cout << "B2's constructor called" << endl; }
};

class Derived: public B1, public B2 {
public:
Derived()
{ cout << "Derived's constructor called" << endl; }
};

int main()
{
Derived d;
return 0;
}


a. B1's constructor called,B2's constructor called
b. B2's constructor called,Derived constructor called
c. B1's constructor called,B2's constructor called,Derived constructor called
d. Compiler error
Answer  Explanation 

ANSWER: B1's constructor called,B2's constructor called,Derived constructor called

Explanation:
When there is multiple inheritance, constructors of the base classes are always called in the derived order ie from left to right and destructors are called in the reverse order.


11)   Which tag can be used to insert a horizontal line on a web page?


a. < hr>
b. < br>
c. < line>
d. < line direction = “horizontal”>
Answer  Explanation 

ANSWER: < hr>

Explanation:
The < hr> tag give a thematic break on the page. Example can be change of topic.


12)   To create a checkbox for a form which tag is used?


a. < input type = “checkbox”>
b. < checkbox>
c. < input = checkbox>
d. < cb>
Answer  Explanation 

ANSWER: < input type = “checkbox”>

Explanation:
This tag is used to add a checkbox on a HTML form


13)   If you want to change the text colour to red which of the following tags will you use?

a. < body text = red>
b. < body bgcolour = red>
c. < body colour = red>
d. None of the above
Answer  Explanation 

ANSWER: < body text = red>

Explanation:


14)   To give a larger heading on an HTML page which tag can we use?


a. < head>
b. < h1>
c. < h6>
d. < h10>
Answer  Explanation 

ANSWER: < h1>

Explanation:
The < h1> tags are used to give headings


15)   HTML is a case sensitive language

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
HTML is not a case sensitive language. We can write the syntax in any case lowercase or uppercase.