Technical Interview Questions and Answers :: TCS
1. Wha is difference between DDL and DML command?| | |
2. What is self join?| | |
3. What are the principle concepts of OOPS?| | |
4. What is method overloading and overriding?| | |
5. Why multiple inheritance is not supported in java?| | |
6. What is Exception Handling? What is difference between Checked Exception and Unchecked Exception?| | |
7. What is a container class?| | |
8. What are limitations of union?| | |
9. How can we access private members of a classs?| | |
10. What are the differences between C and C++?| | |
DDL stands for Data Definition Language. DML stands for Data Manipulation Language. DDL commands are used to create,alter,truncate,drop,rename etc. Where DML are used to insert,update,delete,merge etc.,
No Discussion on this question yet!
5. Classes and Object
A method with changed formal parameters will lead to implementing method overloading.
int calculateSum(int i,int j)
float calculateSum(float i,int j)
double calculateSum(double i,int j)
float calculateSum(int i,float j)
The method with the same signature but with changed implementation lead to method overriding and that can occur in a parent child relation of classes. A method defined in parent class can be overridden in its child class with different implementation from its base class.
1. Pointers are supported in C++ while not in Java. The memory management is done automatically with help of part of JVM called Garbage Collector.
2. Multiple inheritance is not supported in Java but supported in C++.
3. There are no structures and unions in Java.
4. There is no scope resolution operator in Java (::).
5. There are no destructors in Java like C++.
6. There is no virtual keyword in Java because all non-static method use dynamic binding.
Multiple inheritence is not supported in Java because of ambuiguity that it causes.
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.
A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behaviour and a well-known interface.
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.
By using a friend function.
A friend function has access to all private and protected members of the class for which it is a friend.
1. C can run most of the code of C, but C can't run C code.
2. C supports procedural programming paradigm whereas C supports both procedural and object oriented programming paradigm.
3. C is a function driven and C is an object driven language.
4. C doesn't allow function definitions within structures whereas in C function definition can be within structures.
5. C doesn't support reference variables but C does support.