ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
   
 
Categories  >>  Software  >>  Java Related  >>  Java J2EE  >>  Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
explain oops concepts with examples?
 Question Submitted By :: Ramanareddy333
I also faced this Question!!     Rank Answer Posted By  
 
  Re: explain oops concepts with examples?
Answer
# 11
OOP is Nothing but Object Oriented Programming.
In OOPs concept is implimented in our real life systems.
OOPs have following features
1. Object - Instance of class
2. Class - Blue print of Object
3. encapsulation - Protecting our data
4. polymorphism - Different behaviors at diff. instances
5. abstraction - Hidding our irrelavance data
6. inheritence - one property of object is aquring to
another property of object

Simple Ex.

Please assume u standing near a car. How to impliments our
OOPs concept for this scenario ?

Simple,
car is a object b'coz it having more functions.
car is a class b'coz it contain more parts and features
inside.
car is a Encapsulation B'coz it protected some unwanted
parts or functions to user
car is a Polymorphism b'coz it have different speed as
display in same speedometer
car is a Abstraction b'coz it hidding more parts by coverig
such as engine,disel tank
car is a Inheritance b'coz one car is a property of more
people. i mean your car is driving bu you, your friend and
your relatives.
 
Is This Answer Correct ?    26 Yes 8 No
Manoj Donga
 
  Re: explain oops concepts with examples?
Answer
# 12
Abstraction: is hiding irrelevant of data

object: Instance of class
class: Blue print of object

polymorphism: different function with different parameter

interface:is semantically related to abstract
members,members by public default.

Encapsulation: capsule with data and object
inheritance: Base class derived from another class
 
Is This Answer Correct ?    26 Yes 11 No
Nirmal Kumar
 
  Re: explain oops concepts with examples?
Answer
# 13
OOPS Concepts are mainly 4

1.Abstraction
2.Encapsulation
3.Inheritance
4.Polymorphisam

Abstraction:- Hidding non-essential features and showing the
essential features
(or)
Hidding unnecessary data from the users details, is called
abstraction.

Real Time example: TV Remote Button
in that number format and power buttons and other buttons
there just we are seeing the buttons, we don't see the
button circuits .i.e buttons circuits and wirings all are
hidden. so i think its good example.

Encapsulation:
Writing Operations and methods stored in a single
class. This is Called Encapsulation

Real Time Example: Medical Capsuals
i.e one drug is stored in buttom layer and another drug is
stored in Upper layer these two layers are combined in
single capsual.

Inheritance:
The New Class is Existing from Old Class, i.e SubClass is
Existing from Super Class.

Real Time Example:
Father and Son Relationship

Polymorphism:
Sinle Form behaving differently in different
Situations.

Example:-
Person
Person in Home act is husband/son,
in Office acts Employer.
in Public Good Citizen.
 
Is This Answer Correct ?    94 Yes 8 No
Vijay
 
  Re: explain oops concepts with examples?
Answer
# 14
abstraction:it shows important data and hide the unwanted data
polymorphism:it shows different behaviors at different instances
Encapsulation:it provides security for the data
inheritance:the process of acquiring the properties of one
object to another object
 
Is This Answer Correct ?    22 Yes 6 No
Srinivas
 
  Re: explain oops concepts with examples?
Answer
# 15
OOP is Object Oriented Programming.
In OOPs concept is implimented in our real life systems.
OOPs have following features
1. Object - Instance of class
2. Class - Collection of Object(Methods and
variable)
3. encapsulation - Protecting our data by data hiding
encapsulation=abstraction+data hiding.
4. polymorphism - Different behaviors at diff. instances
5. abstraction - Hidding our irrelavance data and
showing necessary data to the user.
6. inheritence - one property of one object is aquring
by the another object.

Simple Ex.

Please assume u standing near a car. How to impliments our
OOPs concept for this scenario ?

Simple,
A motor bike is a object b'coz it having more functions.
motor bike is a class b'coz it contain more parts and
features
inside.
motor bike is a Encapsulation B'coz it protected some
unwanted
parts or functions to user
motor bike is a Polymorphism b'coz it have different speed
as
display in same speedometer
motor bike is a Abstraction b'coz it hidding more parts by
coverig
such as engine,disel tank
motor bike is a Inheritance b'coz one car is a property of
more
people. i mean your car is driving bu you, your friend and
your relatives.
 
Is This Answer Correct ?    25 Yes 7 No
Vaibhav Pathak
 
  Re: explain oops concepts with examples?
Answer
# 16
OOP concepts are mainly 4 parts
such as
1.Abstraction
2.Encapsulation
3.Inheritence
4.Polymorphism

1.Abstraction:which means showing essential features and
hiding non-essential features to the user.

for ex. yahoo mail...

when you provide the user name and password and click on
submit button..
it will shows comepose,Inbox,Outbox,sentmails...so and so
when you click on compose it will open...but user doesn't
know what are the actions performed internally....
just it is open only....this is essential
user doesn't know internall actions ...this is non-essential
things...

for ex tv remote..
remote is a interface between user and tv..ryt.
which is no.of buttons like 0 to 10 ,on /oof like that
but we dont know inside remote like circuites...
user no need to know..just he is using essential thing is
remote.
so developer of remote has to hide the circuit becz he
doesn't anything abut remote...this is non-essential thing.

2.Encapsulation: means which binds the data and code.
(or) writing operations and methods in single unit (class).

for example:
A car is having multipls parts..like
stering,wheels,engine...etc..which binds together to form a
single object that is car.

In real time we are using for security purpose...
encapsulation = abstraction + data hiding.

3.Inheritance:
Deriving a new class from the existing class,is
called inheritance

derived(sub class) class is getting all the features from
existing (super class) class and also incorporating some new
features to the sub class.

for ex:
class Address
{
String name;
Srting H.no;
String Street name;
}
class LatestAddress extends Address
{
String City;
String State;
String Country;
}
public class Devendra
{
psvm(----)
{
LatestAddress la = new LatestAddress();
//do assignment...as u wish
}
}

here in the above class LatestAddress getting all features
from the Address class.
here in the LatestAddress class is having total 6 properties
3 from inheited from Address class and 3 properties
incorporated.

4.Polymorphism:
poly means many

one form can perform differently in different scenarios.
(or) we can use multiful forms in multiful scenarios we will
get different results in different scenarios.

polymorphism mainly happens in runtime only..i.e in
overriding itself

for example
class A
{
void test()
{
sop("A");
}
void test1()
{
sop("A()");
}
}
class B extends A
{
void test()
{
sop("B");
}
void test1()
{
sop("B()");
}
void another()
{
sop("another()");
}
}
public class Devendra
{
psvm(---)
{
A a1 = new A();
A a2 = new B();
B b = new B();
a1.test();------> A
a1.test1();-----> A()
a2.test();------> A
a2.test1();-----> A()
b.test();-------> B
b.test1();------> B()
b.another();----> another()


If you have any quires pls mail me at mdevendra@gmail.com
 
Is This Answer Correct ?    47 Yes 15 No
Devendra.m
 
  Re: explain oops concepts with examples?
Answer
# 17
oOP concepts are mainly 4 parts
such as
1.Abstraction
2.Encapsulation
3.Inheritence
4.Polymorphism
 
Is This Answer Correct ?    23 Yes 7 No
Surender Dagar
 
  Re: explain oops concepts with examples?
Answer
# 18
object oriented programming concepts are mainly 4 parts
such as
1.Abstraction
2.Encapsulation
3.Inheritence
4.Polymorphism
 
Is This Answer Correct ?    11 Yes 12 No
Anuj Kumar
 
  Re: explain oops concepts with examples?
Answer
# 19
oops is logical view of the programming languages. it it
identify the charecterstic of the class 0r programming
languages.
it has some elements,if these elements is not fulfill in any
languages that not object oriented language.
class
object
encapsulATION
POLYMORPHISM
inheritence
message passing
runtime binding
security purpose objects
 
Is This Answer Correct ?    12 Yes 7 No
Digvijay Kumar Singh
 
  Re: explain oops concepts with examples?
Answer
# 20
inheritence=as inheriting establish parent child reletionship b/w classes parent members consumed by child classes 
Is This Answer Correct ?    7 Yes 7 No
Nazeer
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Hi, This is ravi i have a question like this i have string "UNDERSTAND" now i want to count the letters how many times it occures.i.e from the above string the out put should be like this U-1,N-2,D-2,E-1,R-1,S-1,T-1,A-1. how can i achieve this Thnaks in advance for your response ..  7
Difference between interface and abstract class with ex. Tech-Mahindra4
What do you mean by the term transient? Ericsson5
What is a super class and how super class be called?  3
how to compile jsp? Logica-CMG4
what is the difference b/w PUT and POST method to send data to the server Mind-Tree4
Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vice versa?  1
what is difference between colection and collections? Tech-Mahindra20
explain the life cycle of thread? CTS9
can we override the main() method in java????  3
Have you worked on bits programming? examples?What is bit? How many bits are there in the byte?  1
wat is final...? wat is finally...? wat is finalize....? difference between " final and finally and finalize "...?  2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2012  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com