adspace


What is class in oop with example?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

2277


Please send ford technologies placement paper 2 my mail id

2174