Java/PL/SQL/C/SE Test Set 1

1)   Which is true about a method-local inner class? (Java)

a. It must be marked final.
b. It can be marked abstract.
c. It can be marked public.
d. It can be marked static.
Answer  Explanation 

ANSWER: It can be marked abstract.

Explanation:
A class that is created inside a method is called local inner class in java.


2)   Which constructs an anonymous inner class instance? (Java)

a. Runnable r = new Runnable() { };
b. Runnable r = new Runnable(public void run() { });
c. Runnable r = new Runnable { public void run(){}};
d. System.out.println(new Runnable() {public void run() { }})
Answer  Explanation 

ANSWER: System.out.println(new Runnable() {public void run() { }})

Explanation:
The anonymous classes enables to make the code more concise. It enables to declare and instantiate a class at the same time. They are like local classes but they do not have a name.


3)   Which of the following allows the programmer to destroy an object x? (Java)

a. x.delete()
b. x.finalize()
c. Runtime.getRuntime().gc()
d. Only the garbage collection system can destroy an object.
Answer  Explanation 

ANSWER: Only the garbage collection system can destroy an object.

Explanation:
When an object is no longer referenced, it can be reclaimed by the garbage collector. If an object declares a finalizer, it is executed before the object is reclaimed to give the object a last chance to clean up resources that would not otherwise be released. When a class is no longer needed, it may be unloaded.


4)   Which of the following statements are correct? (Java)

a. If multiple listeners are added to a component only events for the last listener added will be processed
b. If multiple listeners are added to a component the events will be processed for all but with no guarantee in the order
c. Adding multiple listeners to a comnponent will cause a compile time error
d. You can not remove or add listeners to a component.
Answer  Explanation 

ANSWER: If multiple listeners are added to a component the events will be processed for all but with no guarantee in the order

Explanation:
Listeners are known as interfaces. Whenever a listener is created all the methods of the listener should be implemented.


5)   What can cause a thread to stop executing? (Java)

a. The program exits via a call to System.exit(0);
b. Another thread is given a higher priority
c. A call to the thread's stop method
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
There are various ways by which a thread can stop executing like the stop() or exit() command. Maybe a higher priority thread comes in or even some system problems may occur.


6)   Which of the following methods are members of the Vector class and allow you to input a new element? (Java)

a. addElement
b. insert
c. append
d. addItem
Answer  Explanation 

ANSWER: addElement

Explanation:
The add element is used to add specified components to the end of the vector and increase its size by one. The addElement() does not return any value.


7)   Nested tables are a good choice when -
(PL/SQL)


a. The index values are not consecutive.
b. There is no set number of index values. However, a maximum limit is imposed.
c. You need to delete or update some elements, but not all the elements at once.
d. You would usually create a separate lookup table, with multiple entries for each row of the main table, and access it through join queries.
e. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
A nested table is similar to index by table but it can be stored in the database columns. It can be considered as a single column table that can either be in a memory or as a column in a database table. The elements can be deleted or added anywhere in a nested table. It may even contain empty elements.


8)   The comparison methods are used for comparing objects. How many ways are available for comparing objects? (PL/SQL)

a. 4
b. 1
c. 2
d. 5
Answer  Explanation 

ANSWER: 2

Explanation:
The 2 methods used for comparing objects are
Map Method- It is a function implemented in such a way that its values depends depends upon the value of the attributes

Order Method- It implements some internal logic for comparing two objects.


9)   In PL/SQL, a warning or error condition is called an exception.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
An error condition during a program is known as an exception. The exception block is used in the program and an appropriate action is taken against the error condition.
There are 2 types of exceptions
1. System-defined exceptions
2. User-defined exceptions.


10)   “NO_DATA_FOUND” and “TOO_MANY_ROWS” are the two most common errors found when executing a SELECT statement. (PL/SQL)

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
The “NO_DATA_FOUND” error is where the program is not able to find any data. This type of error can be trapped by the exception block.
The “TOO_MANY_ROWS” error is where one row data is conflicting with another row data so it is unable to fetch a particular data. This error too can be trapped by the exception block.


11)   Which of the following returns the current value in a specified sequence. (PL/SQL)

a. CURRVAL
b. NEXTVAL
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: CURRVAL

Explanation:
The CURRVAL returns the current value of the sequence.


12)   Which operators combine the results of two queries into one result? (PL/SQL)

a. Set operator
b. Row Operator
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Set operator

Explanation:
The set operators combines the results of two queries into a single result. Queries which contain these set operators are known as compound queries.


13)   In c programming a function can return ___________

a. Single value
b. Double value
c. Many value
d. all of the above
Answer  Explanation 

ANSWER: Single value

Explanation:
All the C functions can be called with or without the arguments.


14)   Array index always start from
(C programming)


a. 0
b. 1
c. 2
d. 3
Answer  Explanation 

ANSWER: 0

Explanation:
The array always starts with 0 because it is a sort of efficiency. The Zero-based indexing simplifies the array-related math for the programmer, and simpler math leads to fewer bugs.


15)   The function that calls itself for its processing is known as.
(C programming)


a. Inline Function
b. Nested Function
c. Overloaded Function
d. Recursive Function
Answer  Explanation 

ANSWER: Recursive Function

Explanation:
A function that calls itself is known as a recursive function and its technique is known as recursion.


16)   Which of the following cannot be checked in a switch-case statement?
(C programming)


a. Character
b. Integer
c. Float
d. enum
Answer  Explanation 

ANSWER: Float

Explanation:
The switch-case is defined by the language specification to use an int value so you cannot use a float value.


17)   What is the default return-type of getchar()? (C programming)

a. char
b. int
c. char *
d. Reading character doesn't require a return-type
Answer  Explanation 

ANSWER: int

Explanation:
The getchar needs to remove some abnormal state. Say for example read error or end of file (EOF = -1). Here the returned value is not 0-255 so It is not possible to represent such cases with char type.


18)   Identify the wrong syntax
(C programming)


a. typedef struct { member declaration; } NAME; NAME V1, V2;
b. typedef struct tag{ member declaration; } NAME; NAME V1, V2;
c. typedef struct { member declaration; } NAME; NAME V1, V2;
d. typedef struct tag { member declaration; } NAME; NAME V1, V2;
Answer  Explanation 

ANSWER: typedef struct tag { member declaration; } NAME; NAME V1, V2;

Explanation:
No explanation is available for this question!


19)   The Bedrock that supports software Engineering in layered technology.

a. Methods
b. Tools
c. Process
d. Quality Focus
Answer  Explanation 

ANSWER: Quality Focus

Explanation:
Quality is important to all the organizations. A commitment to quality is the bedrock on which the success of the organization would lie. Continuous improvements should be made to improve the quality.


20)   Spiral model is a combination of both, Iterative model and one of the SDLC model.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
The spiral model is a risk driven process model generator for the software products. Based on the unique risk patterns it guides the team to adopt elements of one or more process models.


21)   If the software process were not based on scientific and engineering concepts it would be easier to re-create new software than to scale an existing one is known as.

a. Cost
b. Dynamic Management
c. Large Software
d. Scalability
Answer  Explanation 

ANSWER: Scalability

Explanation:
Scalability is the ability of the system, network or process to handle the growing amount of work in a capable manner or its ability to enlarge.


22)   Effective software project management focuses on the four P’s. What are those four P’s?

a. People, performance, payment, product
b. People, product, process, project
c. People, product, performance, project
d. All of the above.
Answer  Explanation 

ANSWER: People, product, process, project

Explanation:
For effective software management we have to use the 4 P's.
People-these are the people who are there in the process throughout.
Product- the product scopes and objectives should be established for management.
Process- it is important to select the appropriate process model
Project- its a series of step where we need to take and make accurate decisions for a successful project.


23)   Software quality assurance is an umbrella activity.

a. True
b. False.


Answer  Explanation 

ANSWER: True

Explanation:
SQA is the process of of evaluating the quality of a product and enforcing adherence to software product standards and procedure. The umbrella activity ensures the conformance to standards and procedures throughout the SDLC of the software products


24)   What are the signs that a software project is in trouble?

a. The product scope is poorly defined.
b. Deadlines are unrealistic.
c. Changes are managed poorly.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


25)   25. Choose the correct option according to given below statement.

Statement 1: Umbrella activities are independent of any one framework activity and occur throughout the process.
Statement 2: software quality assurance, software configuration management are umbrella activity.
Statement 3: software quality assurance, software configuration management are not umbrella activity.


a. Only statement 1 is correct.
b. Statement 1 and statement 2 are correct.
c. Only statement 3 is correct.
d. Statement 1 and statement 3 are correct.
Answer  Explanation 

ANSWER: Statement 1 and statement 2 are correct.

Explanation:
The umbrella activity ensures the conformance to standards and procedures throughout the SDLC of the software products.