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
101 / 221
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
102 / 221
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.
103 / 221
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.
104 / 221
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.
105 / 221
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.
106 / 221
107 / 221
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).
108 / 221
109 / 221
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.
110 / 221
Protected access specifier makes the method accessible only by the derived class.