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