Series: Subject: Topic:

OOPS Interview Questions

Showing Questions 21 - 40 of 85 Questions
First | Prev | | Next | Last Page
Sort by: 

Can we inherit priVATe members of class ?

Asked By: Anjaly | Asked On: Jul 27th, 2006

Answered by: ProgrmmingBOT on: Nov 20th, 2011

we cannot inherit private members of a class,but you can use friend functions to access private data

Answered by: sean on: Oct 10th, 2011

if you can declare the sub class in the base class (i.e if you make sub class as inner class in base class), you will be able to access the private members of the base class.

Differentiate patterns and framework in ooad concept

Asked By: abegmd | Asked On: Sep 14th, 2011

Answered by: Anand Kumar on: Oct 31st, 2011

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...

What is the use/advantage of function overloading

Asked By: harsha | Asked On: Oct 5th, 2005

Please suggest use of fo

Answered by: dharme kalita on: Sep 22nd, 2011

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.

Answered by: mahek.j.mehta on: Mar 1st, 2010

It is useful for Saving the Memory.

C++ single program

Asked By: chamma | Asked On: Nov 13th, 2010

Write a program in C++ using encapsulation, inheritance, polymorphism and abstraction all the concepts should come in a single program.

Answered by: nikki on: Aug 21st, 2011

I think all programs in C++ possess all features of object we can implement a single & simpler program. for eg:- "cpp for eg:- class Student{ ...

Array question

Asked By: Apra Kumar | Asked On: Aug 11th, 2011

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

Answered by: rizwan on: Aug 20th, 2011

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[...

Answered by: Srinivas on: Aug 15th, 2011

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

Asked By: galam | Asked On: Dec 22nd, 2008

Answered by: a naveenkumar on: Aug 10th, 2011

There are two ways:
1. new operator
2. new Instance() method. (Reflection API)

Answered by: Benzihar on: Aug 7th, 2011

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

1.Why do we need encapsulation?2. What is a class in C++ analogous to in C

Asked By: harsha | Asked On: Nov 5th, 2005

Answered by: RAJEEV16706 on: Sep 8th, 2006


Answered by: Raja Muthusamy on: Jun 16th, 2006

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

Asked By: khadarzone | Asked On: Apr 14th, 2008

What is the difference between aggregation and composition?(asked in polaris interview for Java experienced people, on april 11, in chennai)

Answered by: sunilchandel on: Feb 25th, 2011

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...

Answered by: beekal on: May 25th, 2010

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)

Asked By: k.ramasubramanian | Asked On: Sep 28th, 2007

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)

Star Read Best Answer

Editorial / Best Answer

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

Answered by: kishord_it on: Nov 14th, 2010

Waterfall model is used for this technique

Answered by: jasvinderSingh on: Feb 26th, 2010

Static class can be inherited in super class.
.NET architecture is COMPONENT ORIENTED not a OOPS and bottom-up method is used.

Package access modifier

Asked By: it.hce | Asked On: Feb 7th, 2010

What do you mean by package access modifier?

Answered by: shatish15 on: Sep 3rd, 2010

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.

Answered by: shamli85 on: Apr 2nd, 2010

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?

Asked By: venkateshwar | Asked On: Sep 26th, 2006

Answered by: paritoshgautam on: Jul 22nd, 2010

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.

Answered by: adeelqamar8 on: Sep 12th, 2008

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.

Asked By: kavitha | Asked On: Jul 26th, 2006

Answered by: ripon07 on: Jul 13th, 2010

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...

Answered by: rajani_vaddepalli15 on: Sep 15th, 2008

ans: using Templates

Explain the encapsulation principle

Asked By: Interview Candidate | Asked On: Aug 4th, 2005

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...

Answered by: srinathbairu on: Jun 24th, 2010

Every program deals with two elements:
1) Data 
2) Code [function]
Combining these two elements into a single unit is known as Encapsulation (Binding).

Answered by: dkapadia on: Sep 4th, 2008

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 ...

Explicit constructor

Asked By: rahulsweet | Asked On: Feb 3rd, 2010

What is explicit constructor?

Answered by: clipspiker on: Jun 4th, 2010

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...

Answered by: cordialamit on: Mar 6th, 2010

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?

Asked By: ykbharat | Asked On: Mar 13th, 2007

Answered by: shamli85 on: Apr 2nd, 2010

1. Constructor always has its Class name.

2. No return types
3. can't be final or static

Answered by: Ashwani Kabra on: Mar 21st, 2007

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.

Java polymorphism

Asked By: tariqueanwer | Asked On: Dec 28th, 2008

Describe why Java supports only runtime polymorphism?

Answered by: kapilghodawat on: Mar 25th, 2010

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...

Answered by: tarun23 on: Nov 1st, 2009

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

Asked By: Adit Agarwal | Asked On: Apr 30th, 2007

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...

Answered by: shanthankumar on: Dec 4th, 2009

No, though C supports structures, but the variables are public. hence it doesnt.

Describe the principles of OOPS

Asked By: Interview Candidate | Asked On: Aug 4th, 2005

There are three main principals of OOPS which are called polymorphism, inheritance and encapsulation

Answered by: nkumar1095 on: Oct 8th, 2009

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...

Answered by: snvgram on: Jan 9th, 2009

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

Asked By: pohme_pohme | Asked On: Jun 16th, 2008

Answered by: a_l_soni on: Oct 1st, 2009

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...

Answered by: Gothic on: Feb 24th, 2009

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

Asked By: Interview Candidate | Asked On: Jun 11th, 2005

Inheritance is the process by which one object acquires the properties of another object.

Answered by: goksn on: Sep 9th, 2009

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 ...

Answered by: jdoe123 on: Aug 6th, 2007

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.

First | Prev | | Next | Last Page





twitter fb Linkedin GPlus RSS


Interview Question

 Ask Interview Question?


Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.