What is class in oop with example?



What is class in oop with example?..

Answer / Abhinay Kandrap Kumar

A 'class' is a blueprint for creating objects in OOP. For example, the following is a simple class definition for a Rectangle: `class Rectangle {n private:n double width;n double height;n n public:n Rectangle(double w = 0, double h = 0) : width(w), height(h) { }n double GetArea() { return width * height; }n};`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What are different oops concepts?

1 Answers  


What is polymorphism in oops?

1 Answers  


Does c++ support multilevel and multiple inheritance?

9 Answers   IBS, Wipro,


Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.

2 Answers  


What is the real life example of polymorphism?

1 Answers  


Give two or more real cenario of virtual function and vertual object

1 Answers   TCS,


What is super in oop?

1 Answers  


Why do we need oop?

1 Answers  


what is the need of abstraction? what is abstraction?what is the abstraction for stack?

8 Answers   CTS, Verizon,


What is virtual Function.

1 Answers   Wipro,


What is polymorphism in oop example?

1 Answers  


program for insertion ,deletion,sorting in double link list

1 Answers  


Categories