What is oops concept with example?



What is oops concept with example?..

Answer / Arvind Kumar Gupta

Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects. An object contains data and methods that operate on the data. Here's an example in Java:
class Rectangle {n private int width, height;
// constructor
public Rectangle(int w, int h) {n width = w;nh height = h;n }n // method to calculate area
public double getArea() {n return width * height;n }n}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is byval and byref? What are differences between them?

1 Answers   HCL, Wipro,


class type to basic type conversion

1 Answers  


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1 Answers  


What is balance factor?

1 Answers  


monkey starts climbing up a tree 20ft tall,each hour ,it hops 3ft and slips back by 2ft .how much time it wil tak to reach top of the tree?

13 Answers   IonIdea,


What is solid in oops?

1 Answers  


What Is a Polymorphism? How many types of polymorphism and whats that use in application?

2 Answers  


What is and I oop mean?

1 Answers  


What is cohesion in oop?

1 Answers  


What is the difference between procedural programming and oops?

1 Answers  


what is object oriented programming and procedure oriented programming?

3 Answers  


What is the advantage of oop over procedural language?

1 Answers  


Categories