Home  >  Article  >  Java  >  Does the Java keyword contain "default"?

Does the Java keyword contain "default"?

WBOY
WBOYforward
2023-04-23 13:13:081051browse

Is default a java keyword:

Answer: default is a keyword in java8, also called "virtual extension method s”.

The Chinese translation is called "Virtual Extension Method", which contains some default usage methods in the interface.

When the interface is extended, will not conflict with the implementation class code related to the interface .

Does the Java keyword contain default?

Introduction to default and java:

1. The previous interface was a double-edged sword, capable of abstraction but not specific programming. 2. The disadvantage of this is that when you need to modify the interface, you must first

modify all classes

that implement the interface. 3. When you cannot add new methods to the interface, it will not affect the existing display, so

has added the default method

, We have

solved a series of problems

with interface modifications and display incompatibilities for everyone.

The above is the detailed content of Does the Java keyword contain "default"?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete