ICSE Class 10 Computer Applications Question 18 of 25

Class as Basis of All Computation — Question 18

Back to all questions
18
Question

Question 18

Why are classes needed ?

Answer

In Java, the class forms the basis of all computation. A class is a blueprint for an object and an object is an instance of a class. It allows a programmer to define all of the properties and methods that define an object.

Anything that has to exist as a part of a Java program has to exist as a part of a class, whether that is a variable or a function or any other code-fragment. Without classes, there can be no objects and without objects, no computation can take place in Java. Thus, classes form the basis of all computation in Java.