Technical Interview Questions and Answers :: Syntel Inc.
- Select All
- Oracle PLSQL
- Java
- C++
- WebMethod
- C
- DBMS
- Operating System
- Oracle Apps HRMS
- Networking
- Soft. Engineering
- HR Question in TR
- Data Structure
- .NET
- SQL
21 / 161
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.
22 / 161
In C , function declaration is means telling the compiler that a function occurs but there's no definition given to it. When in the program, the function with definition is given, it's known as function definition.
For eg.: void display();//function declaration
void display){ cout<<"Function Definition";}//Function Definition
23 / 161
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.
24 / 161
1. C supports pointers, Java doesn't.
2. Multiple inheritence is supported in C but not in Java.
3. Java has built-in support for threads whereas C doesn't have built-in support for threads.
4. No destructors in Java but C has them.
5. C supports both method and operator overloading, Java only supports method overloading.
25 / 161
Classes are user defined data types and behave like the built-in type of a programming language. The wrapping up of data and functions into a single unit called class.
Objects are the basic run-time entities in an object-oriented system. When a program is executed, the objects interact by sending messages to one another.
26 / 161
27 / 161
Yes, struct is similar to class, only all attributes/methods are public by default in the struct. You can very well have methods and attributes in a struct. You can also inherit from a struct (default inheritance is public).
28 / 161
29 / 161
Yes, Size of an empty class is not zero. It is 1 byte generally. It is nonzero to ensure that the two different objects will have different addresses.
30 / 161
Protected access specifier makes the method accessible only by the derived class.