answersLogoWhite

0

A superclass, also referred to as a parent class, is a class what which other classes are derived from. These derived classes are known as either subclasses or child classes.

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

In java why method defined in super class need not to defined in subclass?

In Java, or in any object oriented language such as C++, a method defined in super (parent) class does not need to be defined in a subclass, because that is the primary purpose of inheritance. Object oriented programming allows you to define and declare a class that implements the behavior for an object. Inheritance allows you to refine, or subclass, that class by "reusing" all of the functionality of the parent class into the sub class, adding additional definition and declaration for the sub class. If the subclass needs to change a parent class method, it can overload that method. This is called abstraction.


What class is the super class for ALL Java classes?

The Object class, in the java.lang package, sits at the top of the class hierarchy tree. Every class is a descendant, direct or indirect, of the Object class. Every class you use or write inherits the instance methods of Object. You need not use any of these methods, but, if you choose to do so, you may need to override them with code that is specific to your class


Benefits of inheritance in Java programming?

Advantages of Inheritance1) Code Re-usability2) consumes less time3) Without changing the super class we can add some more methods in the super class by inheriting it in the derived class


How constructor called?

You cannot invoke a constructor explicitly. It will get invoked implicitly when you call the new keyword on the class to create an object of the class. Ex: private ClassExample obj = new ClassExample(); here this new keyword usage on the ClassExample class will invoke the constructor of this class and create an object of that class.


What is oops?

When you delete a file from your computer the file is not really deleted, it is merely left there & the space it occupies is made available to be written over. 'Oops' is a program that allows you to call up deleted files & by restoring the name of the file to the original name (by the addition of the first character of the original name) rewrites them to disc. e.g. Original file name was backup.exe. when file is deleted it becomes _ackup.exe when using 'oops' you simply put the 'b' on to the deleted & it is restored. Object Oriented Programming System

Related Questions

Which class includes all the others?

Super class in object oriented programming


Which object-oriented concept defines the relationship between a subclass and a super class?

Inheritance


In java why method defined in super class need not to defined in subclass?

In Java, or in any object oriented language such as C++, a method defined in super (parent) class does not need to be defined in a subclass, because that is the primary purpose of inheritance. Object oriented programming allows you to define and declare a class that implements the behavior for an object. Inheritance allows you to refine, or subclass, that class by "reusing" all of the functionality of the parent class into the sub class, adding additional definition and declaration for the sub class. If the subclass needs to change a parent class method, it can overload that method. This is called abstraction.


Where does inheritance take place?

Inheritance, in the context of object-oriented programming, takes place between classes where one class (called the sub-class or child class) inherits attributes and methods from another class (called the super-class or parent class). This allows for code reusability and the establishment of a hierarchical relationship between classes.


What is object class in java?

object class is a super class for all other class...


What are the applications of super and this keyword?

The super and this keywords are mainly used in case of inheritance. this - refers to the object of the current class instance super - refers to the object of the instance of the parent class of the current class.


What do you mean by object?

In advanced programming languages, the re-usability of a portion of code capable of performing a given function is an unique advantage. The compartmentalization of a code which can be reused later and invoked by the class name is referred as object inheritance. In classical inheritance classes are used while in object inheritance sub classes and super classes are add-on features. It saves lengthy redundant coding by inherting the desired code function and calling it by name . -JP Morgan


What class is the super class for ALL Java classes?

The Object class, in the java.lang package, sits at the top of the class hierarchy tree. Every class is a descendant, direct or indirect, of the Object class. Every class you use or write inherits the instance methods of Object. You need not use any of these methods, but, if you choose to do so, you may need to override them with code that is specific to your class


How can you access the super class variables with out any object creation?

Variables of the super class can be accessed using the super keyword. Here is an example. class A { int a; } class B extends A { int a; public B() { super.a = 5; } }


Why Object is Super Most Class In Java?

It's part of the language specification that all objects in Java must inherit from Object. Java defines a strict class hierarchy, and enforcing a "super most class" ensures that this ordering is maintained.


Benefits of inheritance in Java programming?

Advantages of Inheritance1) Code Re-usability2) consumes less time3) Without changing the super class we can add some more methods in the super class by inheriting it in the derived class


What is a super class and how will you call a super class?

In object oriented programming, we talk about classes having "super" or "sub" classes, sometimes called "base" and "derived" classes. In all cases this is talking about something called "polymorphism", which basically means the ability to use one object just as you would another. The way this is achieved is by deriving or "subclassing" another class. in C#, you use the : operator as shown here: class Ford : Car in Java, you use the extends keyword: class Ford extends Car This basically means the "Ford" class will get all of the same features and functions of Car without having to rewrite them -- that is because "Ford" *IS* a "Car". One example of this is if I have a function that asks for a type of "Car", you can simply pass your "Ford" to it, and it would work without the function even knowing it was dealing with a Sub class. function string GetName(Car car) { return car.getName(); } Ford f = new Ford(); System.out.println(GetName(f)); If you want to "call" to the super class from within the derived (sub) class -- you can use the identifier "super" (in c#, you use "base"): protected override getName() { return super.getName(); } Hope that helps!