हिंदी

How does a Class differ from an Abstract Data Type?

Advertisements

प्रश्न

How does a Class differ from an Abstract Data Type?

अंतर स्पष्ट करें
Advertisements

उत्तर

Class

Abstract Data Type (ADT)

1. A class is a blueprint or template used to create objects in object-oriented programming.

1. An Abstract Data Type is a logical model that defines a data type and the operations that can be performed on it.

2. A class defines the data members and methods that describe the properties and behaviour of its objects.

2. An Abstract Data Type defines the values and operations of a data type without specifying how they are implemented.

3. A class provides the actual implementation of data and methods in a programming language.

3. An Abstract Data Type describes what operations can be performed without explaining how those operations are carried out.

4. A class is a programming construct that is used to implement object-oriented concepts.

4. An Abstract Data Type is a theoretical concept that is used to organise data and define its operations.

5. A class can contain variables, constructors and methods to create and manage objects.

5. An Abstract Data Type specifies a set of values and permitted operations independently of any particular implementation.

6. A class can be used to implement an Abstract Data Type in Java.

6. An Abstract Data Type can be implemented using classes or other suitable programming constructs.

7. Example: A Stack class in Java can implement methods such as push() and pop().

7. Example: A Stack ADT defines operations such as push() and pop() without specifying their implementation.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 4: Objects - EXERCISE [पृष्ठ १०७]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 4 Objects
EXERCISE | Q 4. | पृष्ठ १०७
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×