What is the use/advantage of function overloading
Please suggest use of fo
using the concept of function overloading; we can design a family of functions with one function name but with different argument lists. the function would perform different operations depending on the argument list in the function call.
It is useful for Saving the Memory.
Write a program in C++ using encapsulation, inheritance, polymorphism and abstraction all the concepts should come in a single program.
I think all programs in C++ possess all features of object oriented.so we can implement a single & simpler program. for eg:- "cpp for eg:- class Student{ ...
If there are 2 arrays named as test & sample with 20 integer elements in each of these declared as int test[20], sample[20], then which of the following statement is wrong? a)test=sample b)sample=test c)both a & b d)none of the above
in C# arrays are reference variables , so both a and b are correct"c# static void Main(string[] args) { int[] a = new int[5]; int[] b = new int[...
Both a and b are wrong.Option c is correct,Because int test[20] contains 20 elements with different address locations that are differ from int sample[20] addresses
How many ways to create objects in Java
There are two ways:
1. new operator
2. new Instance() method. (Reflection API)
1. Using new keyword This is the most common way to create an object in java. I read somewhere that almost 99% of objects are created in this way. MyObject object = new MyObject(); 2. Using Class.fo...
1.Why do we need encapsulation?2. What is a class in C++ analogous to in C
WELL DESIGNED MODULES ALWAYS HIDES ALL OF ITS IMPLEMENTAIONS DETAILS. MODULES THEN COMMUNICATE WITH EACH OTHER ONLY THROUGH API's UNKNOW TO EACH OTHER INNER IMPLEMENTATIONSPROPER USE OF ACCESS MODIFIE...
In order to bind the data and functions working on it and to safegaurd our data and funtcions from outside access (access from the other objects) we need Encaptulations.
Difference between aggregation and composition
What is the difference between aggregation and composition?(asked in polaris interview for Java experienced people, on april 11, in chennai)
Composition:- All forms of composition include a has-a relationship.There is two type of composition : association and aggregation.Aggregation :- complex object is composed of other objects. e.g TV As...
Composition gives a part of relationship e.g Engine ----------------------- part of ------------------------------CArDestroy car then engine would be automatically destroyed along with car. In such ca...
Can static class be inherited in super class? If so how. what are the various types of OOPS in dot net architecture?What is the method that is used in dot net (like top-down, water fall)
Answered by: santosh.ifc
View all answers by santosh.ifc
Member Since Oct-2007 | Answered On : Mar 19th, 2008
the static method will be inherited to the sub class only
Waterfall model is used for this technique
Static class can be inherited in super class.
.NET architecture is COMPONENT ORIENTED not a OOPS and bottom-up method is used.
What do you mean by package access modifier?
I don't understand how you can say about the private and protected access modifiers for a class. When I created a program with private and protected access modifiers, the error was that these modifiers are not allowed here.
We can use protected and private modifier with a Class only if it is an inner Class.
What is the difference between instance and object?
Suppose there are number of classes and their objects whenever we call a particular object at run time then memory is allocated to that particular object and that is called Instance.
When you create a custom type (class) in any language, that class in OOP is called Object and when you create an istance of this class just as we create instance of built-in types e.g. (int a,float b) it is called instance of the object.
How to implement the runtime polymorphism using c++. Examples.
First We Know that Polymorphism means Single Interface Multiple Methods so whenever we want to implement this into our program we use it in form of function overloading and operator overloading but th...
ans: using Templates
Explain the encapsulation principle
Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed...
Every program deals with two elements:
1) Data
2) Code [function]
Combining these two elements into a single unit is known as Encapsulation (Binding).
Encapsulation with a simple example would be .Automatic Transmission on an automobile. It encapsulates 100's of bits of information about your engine, such as how much are accelerating, the pitch ...
What is explicit constructor?
Java objects extend Object class and hence inherit a default constructor. Thus every class can be instantiated using the default constructor. This is made possible by constructor chaining. However, it...
Explicit constructor is actually a parameterized constructor which takes some parameters in order to create instance of a class.E.g. Class Sample &...
How do you differentiate a constructor from a ordinary function?
1. Constructor always has its Class name.
There are three differences.
1. In Java constructor has its class name. that can be unique. In .NET it has "NEW" by name.
2.It does not have any return type.
3. It cannot be subclass.
Describe why Java supports only runtime polymorphism?
Real polymorphism has to be at run time. Think of this scenario, Java has exposed JDBC drivers interface and you load the driver class at runtime. Using the same code you can connect to any JDBC compl...
The three ways of polymorphism in Java are method overloading, method overridding and method overridding by extending an class. All these results come true when we run our class which is overloading o...
Does C also supports abstraction
Abstraction is defined as hiding details from the end user who should be in no way concerned about the details of the internal mechanism on implementation...But then the same can be achieved in C also , I can use functions, and can comfortably be unaware of theinternal complications of the same, so can...
No, though C supports structures, but the variables are public. hence it doesnt.
Describe the principles of OOPS
There are three main principals of OOPS which are called polymorphism, inheritance and encapsulation
Abstraction: Involves extracting only the relevant information.Encapsulation: Involves packaging one or more components together.Inheritance: Is a process of creating a new class by adding some featur...
The four basic principle of OOP are:AbstractionEncapsulationHierarchyand ModularityPlease note that there are many other object oriented principles, but the above the are basic ones.We can refer Class...
What is the difference between class and instance
Class contains the declaration and definition of all of it member variables and the member functions, along with their respective access specifiers. A Class remains same for all of it's objects or...
The Class is a blueprint which holds the code, but the instance is the real object inside the memory so we can access its properties and methods in the Run-time.
Explain the inheritance principle
Inheritance is the process by which one object acquires the properties of another object.
Inheritance is one of the important principles of OOP.Inheritance is the process by which one object acquires the properties of another object.By use of Inheritance , an object need only define those ...
Inheritance involves building upon an existing class so that additional or more-specialised functionality is added.
A key design aspect of inheritance is that it is used in a manner which is understandable and supported by a clear, justifiable relationship.
Explain component object model used in c, C++ and .Net
COM is a platform-independent, distributed, object-oriented system for creating binary software components that can interact.
The Component Object Model (COM) is a component software architecture that allows applications and systems to be built from components supplied by different software vendors. COM is the underlying arc...
Patterns: . A common Solution to a common problem in a context.A solution to narrowly-scoped technical problem. i.e. A fragment of solution or a piece of the puzzle.... Framework: Defines the gene...