answersLogoWhite

0

Why do you extend classes in java?

User Avatar

Anonymous

14y ago
Updated: 8/19/2019

We use the classes in java to reuse their coding for the child classes.So as to save our time and development overhead.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the super clas of class?

All Java classes with no defined superclass, extend from java.lang.Object.


What are sealed classes in java?

Final classes are sealed classes in java I guess.


Give the structure of multiple inheritance?

Java does not support multiple inheritance. It is done with the help of interfaces in java. a class can implement n number of interfaces, thus showing multiple inheritance. but a class cannot extend multiple classes in java.


What is Difference between java and core java?

Java or Java SE comes with the standard library, with all the crazy classes to make life easy. Java Core does not come with most of these classes, so that it is a lot smaller.


What is a collection of related classes called in java?

a package


How do structure and class provide inheritance differently in Java?

In Java, classes provide inheritance through a hierarchical structure where a subclass can inherit fields and methods from a superclass, allowing for code reuse and polymorphism. This enables the subclass to extend or override behaviors of the superclass. In contrast, Java does not support inheritance through structures (often used in languages like C), as structures in Java are not a distinct type; instead, classes are the primary way to create complex data types with inheritance capabilities. Consequently, classes are the primary mechanism for implementing inheritance in Java, while structures are not a feature of the language.


How many classes should be included in each java file?

You can only have one non-inner public classes per java file and that class name must match the filename. The java file can also have any number of inner classes and anonymous classes.


How many pre-built or predefined classes are there in JAVA?

In java 1.1 version 250 classes are there java 1.2 version 500 classes are there i don't about other versions. but i want to know other version classes also. please post any body known these other version classes list....


What is global variable in java?

A local class is declared locally within a block of Java code.You can even have classes declared inside a method. such classes are called local classes.


How many types of classes are found in java?

1.Outer Classes 2. Inner Classes


Why we write java program using classes?

Classes are well organised functions in java which help discriminate between two different functions.


Can you compile interface in java?

In Java, you cannot compile an interface directly because interfaces themselves are not executable; they are meant to define a contract for classes that implement them. However, you can compile the interface along with the implementing classes. When you compile a Java program, the Java compiler generates bytecode for all classes and interfaces, which can then be executed by the Java Virtual Machine (JVM).