Answer: A class is defined as the attributes and methods of objects of same type sharing common characteristics. Classes in Java programming are defined as following:
class classname
{
type instance-variable1;
type instance-variable2;
…
type instance-variableN;
type methodname1(parameter-list) {
// body of method
}
type methodname2(parameter-list) {
// body of method
}
…
type methodnameN(parameter-list) {
// body of method
}
}
java.lang.Object is the root class for all the java classes and we don’t need to extend it.
-
This reply was modified 9 years, 3 months ago by
juwanine.