Technical Interview Questions and Answers :: Virtusa
- Select All
- SQL
- C++
- .NET
- Oracle PLSQL
- Informatica
- WebMethod
- DBMS
- Soft. Engineering
- Data Structure
- Networking
- C
- Operating System
- HR Question in TR
- Java
91 / 221
No Discussion on this question yet!
92 / 221
A collection is an object that can hold references to other objects. The collection interfaces declare the operations that can be performed on each type ofcollection. The classes and interfaces of thecollections framework are in package java.util.
93 / 221
there are two classes.
outer class
inner class
94 / 221
An exception is a problem that arisesduring excecution. Checked exceptions are the exceptions that gets checked at the compile time. Unchecked exceptions are not checked at compile time, in Java all exceptions are unchecked exceptions.
95 / 221
For numbers primitive data types are used normally, such as byte, int, long, double etc. But in programming, objects are sometimes required rather than primitive data types. For this, wrapper classes are available in Java.
96 / 221
1) Encapsulation: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.
2) Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors.
3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means "one interface, multiple methods"; this means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compiler's job to select the specific action (that is, method) as it applies to each situation.
97 / 221
Container class is a class that hold group of same or mixed objects in memory. It can be heterogeneous and homogeneous. Heterogeneous container class can hold mixed objects in memory whereas when it is holding same objects, it is called as homogeneous container class.
98 / 221
A token is the smallest element of a C program that is meaningful to the compiler. The C parser recognizes these kinds of tokens: identifiers, keywords, literals, operators, punctuators, and other separators. A stream of these tokens makes up a translation unit.
99 / 221
Preprocessor directives are lines included in the code of programs preceded by a hash sign (#
). These lines are not program statements but directives for the preprocessor. The preprocessor examines the code before actual compilation of code begins and resolves all these directives before any code is actually generated by regular statements.
100 / 221
This means if one member variable of union is updated then the rest will be updated as well. This also leads compilation error when initializing multiple members at a time as the memory locations are not different. So in case of union only one member should be initialized at a time.