Series: Subject: Topic:

OOPS Interview Questions

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

what are the different types of polymorphism?

Asked By: Interview Candidate | Asked On: Sep 1st, 2005

Answered by: Have Fun on: Dec 28th, 2012

Ad-hoc polymorphism and universal polymorphism

Answered by: kutty on: Sep 24th, 2012

How to write a simple java programs for overloading & overriding

How can recover the memory

Asked By: sansiya.hemant7 | Asked On: Aug 23rd, 2011

Answered by: Nitin Havaldar on: Dec 23rd, 2012

In oops memory is released through garbage collection. it will check which objects are not reachable by any part of the code then it will release that object and optimize the memory location for newly created objects.

Function and method differences

Asked By: Anood Hamadeen | Asked On: Aug 3rd, 2012

What is the difference between function and method in c, objective c, and Java?

Answered by: anil on: Nov 23rd, 2012

Functions have independent existence means they are defined outside of the class e.g. in C main() is a function while methods do not have independent existence they are always defined inside class e.g. main() in Java is called method.

Merits and demerits of friend function

Asked By: nitin sharma | Asked On: Jun 5th, 2006

Answered by: yogesh anasane on: Nov 21st, 2012

1) Sometimes a friend function allows a more obvious syntax for calling a function rather than what a member function can do.
2) Friend function is used to increase versatility of overload operator.

Answered by: Prabhu Kumar V a on: Jun 14th, 2006

merits:   we can able to access the other class members in our class if,we use friend keyword.   we CAN access the members without inheriting the class.demerits:  Maximum size...

What are the types of polymorphism ?

Asked By: rekhaty | Asked On: May 25th, 2012

Answered by: Sirsat Manisha on: Oct 31st, 2012

There are two types of polymorphism. 1. compile time polymorphism 2. Run time polymorphism Compile time polymorphism is also called as "Static polymorphism" or it is referred as "Early binding" Compil...

Answered by: naresh on: Aug 27th, 2012

There are two types of polymorphism 1. Dynamic polymorphism 2. Static polymorphism The polymorphism that can be occur at run time is called dynamic polymorphism. This means that when we call the met...

how can I call a function, given its name as a string?

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

Answered by: neeraj on: Oct 26th, 2012

Ya it possible by using macro

  1. #include<stdio.h>
  2. #define string sum1()
  3. int main(){
  5. int k=string;
  6. printf("%d",k);
  7. getch();
  8. return 0;
  10. }
  11. sum1()
  12. {
  13. int c=6;
  14. int d=7;
  15.  return(c+d);
  16. }

Answered by: jbanx on: Jun 6th, 2007

Hi, This is a typical example of reflection. If you are using .NET then use reflection for this purpose. In this case you create an object of a particular  type and the invoke methods at run time by passing function name.

What is the difference between the object based language and object oriented langauage?

Asked By: Rajesh | Asked On: Mar 7th, 2006

Answered by: neeraj on: Oct 19th, 2012

The object oriented language support the extra two concept that is dynamic binding and inheritance..but in second case they do not support these 2 features...

Answered by: priya on: Feb 3rd, 2012

The main diffrence between object oriented and object based languages is object based languages doesnt support Inheritance where as object oriented supports. C# is a object oriented language because it supports inheritance and ASP.Net is not a langugae it is a technology.

write a program to find the factorial of a number

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

Answered by: richa on: Oct 10th, 2012

  1. class fact
  2. {
  3. public static void main (String orgs[])
  4. {
  5. int n,fact=1;
  6. for(a=n;a>0;a--)
  7. {
  8. fact=fact*n;
  9. system.out.println("factorial of the no is"+fact);
  10. }
  11. }
  12. }

Answered by: Sheenu on: Sep 27th, 2011

//program to find the factorial of a number

  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int a,fact=1;
  6. for(a=1;a<=5;a++)
  7. fact=fact*a;
  8. }
  9. printf("%d",fact);
  10. getch();
  11. }

Explain the advantages of OOPS with the examples.

Asked By: Bir Bahadur Karki | Asked On: Oct 31st, 2006

Answered by: rajanish jha on: Oct 8th, 2012

The main advantage is that it uses real world object and generic programming approach

Answered by: manisha chandani on: Aug 24th, 2012

It is good because it is totally based on objects. It provides the concept of inheritance, encapsulation, polymorphism. With the help of this concepts the code is reusable, get in many forms. Classes support encapsulation.

Design coffee vending machine

Asked By: selvarajc | Asked On: Sep 29th, 2012

How to design coffee vending machine in Java

what are the advantages of inheritance?

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

Answered by: Brijendra on: Sep 23rd, 2012

1) Inheritance is the concept where the child class can concentrate on new features that it want. because all the basic features it will get it from its parent class.

2) It is about re-usability of features.

Answered by: manisha chandani on: Aug 24th, 2012

Helps in reusability of code.
Program development time is reduced.
Helps as security purpose.

What is an abstract class

Asked By: jyothis | Asked On: Oct 7th, 2005

Answered by: manisha chandani on: Aug 24th, 2012

Abstract class is a class which contains atleast one abstract method.
Abstract method-method whose body is not defined.
Object of abstract class cannot be created.

Answered by: vijin on: Apr 9th, 2012

Abstract class is a base class. It is only declare a method and implement this method in a derived class using the override method.
it is declare a abstract keyword, and no need for create object for abstract class.

Dispose()and close() method

Asked By: ajit008 | Asked On: Jun 23rd, 2012

Difference between dispose()and close() method

Answered by: mohammad imran on: Jun 28th, 2012

The basic difference b/w close() & dispose() method is , when a close() method is called , any manage resource can be close temporarily and can e opened once again. It means that, with the same objec...

What is factory class?

Asked By: ashray | Asked On: May 25th, 2007

Answered by: Sandhya.Kishan on: Jun 13th, 2012

It is a class which provide an interface for creating families of related objects.It encapsulate the logic which helps to decide which subclass should be instantiated and hence removes this decision f...

Answered by: 00elton00 on: Aug 4th, 2007

A Factory class is one that is used to return instances of other classes. This is generally used in the context of Factory Design Pattern.

Which languages are included in object based languages other than vb and Java script

Asked By: manoj | Asked On: Feb 21st, 2007

Answered by: Sandhya.Kishan on: Jun 13th, 2012

Object-oriented languages include Simula, Smalltalk, C++, Eiffel, Python, Ruby, C# and REALbasic other than Vb and java script.

Answered by: harpreet sran on: Nov 15th, 2007

Other object oriented languages are c++ & simula 67

What are 4 member function for each object in c++.

Asked By: vijay sagar | Asked On: Aug 15th, 2011

Each C++ object possesses the 4 member fns, what are those 4 member functions.Please tell me what I s the answer for this question.

Answered by: Sandhya.Kishan on: Jun 13th, 2012

Each C++ object has constructor,default constructor,copy constructor and destructor as the member functions.

Answered by: ABC on: Aug 24th, 2011

Following are four default functions available for each object
1) constructor
2) destructor
3) copy constructor
4) assignment operator

Pure virtual functions

Asked By: Gaurav_soni | Asked On: Jul 17th, 2009

How can you make a class as interface, if you cannot add any pure virtual function?

Answered by: Sandhya.Kishan on: Jun 13th, 2012

By putting a “virtual destructor inside an interface” makes a class an interface.

Answered by: sangeeta on: Feb 21st, 2012

Add pure virtual destructor in that class

What is the difference between encapsulation and datahiding.Explain with example

Asked By: ramaprasad | Asked On: Nov 2nd, 2005

Answered by: prabhjot kaur on: May 12th, 2012

Encapsulation is the wrapping up of data members and data functions into a single unit like classes. here we can control the visibility of data with the help of access specifiers i.e. public,private and protected.
in data hiding data is totally private we cannot access the data.

Answered by: shrimanta on: Mar 14th, 2012

Encapsulation is the concept of the datamember. Data Hiding is the Access Specifier.

What do you mean by package access modifier?

Asked By: neven | Asked On: Nov 12th, 2011

Answered by: Sandhya.Kishan on: Mar 10th, 2012

Access modifier are used to implement encapsulation feature of oops.There are 3 access specifiers namely Private: The current class will have access to the field or method. Protected - The current cl...

What are data model and class model in object oriented approach specially in c++?

Asked By: Rahul | Asked On: Aug 20th, 2007

Answered by: Sandhya.Kishan on: Mar 10th, 2012

Data model is an abstract model which describes the representation and usage of data.In oops context data are modeled as units of objects and data model represents the logical organization of real wor...

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.