Computer Science, asked by sanu1888, 1 year ago

7 How is a class a user defined data types​

Answers

Answered by sasha0211
2

Answer:

a class is defined with a number of data types of different types. When an object is created, it contains all the members described within the class .A class becomes such a data type that includes various primitive types

Answered by cyrusbishop
2

Answer:

In the real world, we have much more complicated objects. Java language uses some pre-defined data types such as int, float and char.  

These data types are also known as composite data type, which provide some preliminary facilities in Java programming. When they are used to declare any variable, then the variable would possess its built-in characteristics.  

Similarly, a user may create a data type and declare certain characteristics and behaviour within it. This can be done by using a class.  

This is the reason why a class is referred as user defined data type.  

Similar questions