java_language_specification_java_se_17_edition_chapter_8_-_classes

Java Language Specification Java SE 17 Edition Chapter 8 - Classes

8. Classes

Java Language Specification Java SE 17 Edition Chapter 8 - Classes

vi The Java Language Specification

vii The Java Language Specification


Java Language Specification Java SE 17 Edition Chapter 8 - Classes

Return to Java 17 Language Spec Table of Contents, Java 17 Language Spec, Java Language Specifications, Language Specifications, Java bibliography, Java DevOps, Java, Java topics, Awesome Java, Java development tools

NOTE!!! GETTING DokuWiki INTERNAL SERVER ERROR!!! Break this into smaller subchapter DokuWiki articles!

BREAK IT INTO SMALLER SECTION by section heading.

Break each sentence into snippets for that Java term, construct, grammar, etc. referencing this chapter. e.g. “ (JvLngSpc17 2021, Chapter 8 - Classes)

” (JSR-392 JvLngSpc17 2021)

“ (JvLngSpc17 2021)

Classes

“A class declaration defines a new class and describes how it is implemented (§8.1).” (JSR-392 JvLngSpc17 2021)

“A top level class (§7.6) is a class declared directly in a compilation unit.” (JvLngSpc17 2021, Chapter 8 - Classes)

“A nested class is any class whose declaration occurs within the body of another class or interface declaration. A nested class may be a member class (§8.5, §9.5), a local class (§14.3), or an anonymous class (§15.9.5).” (JvLngSpc17 2021, Chapter 8 - Classes)

“Some kinds of nested class are an inner class (§8.1.3), which is a class that can refer to enclosing class instances, local variables, and type variables.” (JvLngSpc17 2021, Chapter 8 - Classes)

“An enum class (§8.9) is a class declared with abbreviated syntax that defines a small set of named class instances.” (JvLngSpc17 2021, Chapter 8 - Classes)

“A record class (§8.10) is a class declared with abbreviated syntax that defines a simple aggregate of values.” (JvLngSpc17 2021, Chapter 8 - Classes)

“This chapter discusses the common semantics of all classes. Details that are specific to particular kinds of classes are discussed in the sections dedicated to these constructs.” (JvLngSpc17 2021, Chapter 8 - Classes)

“A class may be declared public (§8.1.1) so it can be referred to from code in any package of its module and potentially from code in other modules.” (JvLngSpc17 2021, Chapter 8 - Classes)

“A class may be declared abstract (§8.1.1.1), and must be declared abstract if it is incompletely implemented; such a class cannot be instantiated, but can be extended by subclasses. The degree to which a class can be extended can be controlled explicitly (§8.1.1.2): it may be declared sealed to limit its subclasses, or it may be declared final to ensure no subclasses. Each class except Object is an extension of (that is, a subclass of) a single existing class (§8.1.4) and may implement interfaces (§8.1.5).” (JvLngSpc17 2021, Chapter 8 - Classes)

“A class may be generic (§8.1.2), that is, its declaration may introduce type variables whose bindings differ among different instances of the class.” (JvLngSpc17 2021, Chapter 8 - Classes)

Page 235 CLASSES

Class declarations may be decorated with annotations (§9.7) just like any other kind of declaration.“ (JvLngSpc17 2021, Chapter 8 - Classes)

“The body of a class declares members (fields, methods, classes, and interfaces), instance and static initializers, and constructors (§8.1.7). The scope (§6.3) of a member (§8.2) is the entire body of the declaration of the class to which the member belongs. Field, method, member class, member interface, and constructor declarations may include the access modifiers public, protected, or private (§6.6). The members of a class include both declared and inherited members (§8.2).” (JvLngSpc17 2021, Chapter 8 - Classes)

“Newly declared fields can hide fields declared in a superclass or superinterface.” (JvLngSpc17 2021, Chapter 8 - Classes)

“Newly declared member classes and member interfaces can hide member classes and member interfaces declared in a superclass or superinterface. Newly declared methods can hide, implement, or override methods declared in a superclass or superinterface.” (JvLngSpc17 2021, Chapter 8 - Classes)

Field declarations (§8.3) describe class variables, which are incarnated once, and instance variables, which are freshly incarnated for each instance of the class. A field may be declared final (§8.3.1.2), in which case it can be assigned to only once. Any field declaration may include an initializer.“ (JvLngSpc17 2021, Chapter 8 - Classes)

Member class declarations (§8.5) describe nested classes that are members of the surrounding class. Member classes may be static, in which case they have no access to the instance variables of the surrounding class; or they may be inner classes.“ (JvLngSpc17 2021, Chapter 8 - Classes)

Member interface declarations (§8.5) describe nested interfaces that are members of the surrounding class.“ (JvLngSpc17 2021, Chapter 8 - Classes)

Method declarations (§8.4) describe code that may be invoked by method invocation expressions (§15.12). A class method is invoked relative to the class; an instance method is invoked with respect to some particular object that is an instance of a class. A method whose declaration does not indicate how it is implemented must be declared abstract. A method may be declared final (§8.4.3.3), in which case it cannot be hidden or overridden. A method may be implemented by platform-dependent native code (§8.4.3.4). A synchronized method (§8.4.3.6) automatically locks an object before executing its body and automatically unlocks the object on return, as if by use of a synchronized statement (§14.19), thus allowing its activities to be synchronized with those of other threads (§17 (Threads and Locks)).“ (JvLngSpc17 2021, Chapter 8 - Classes)

Method names may be overloaded (§8.4.9).“ (JvLngSpc17 2021, Chapter 8 - Classes)

Instance initializers (§8.6) are blocks of executable code that may be used to help initialize an instance when it is created (§15.9).“ (JvLngSpc17 2021, Chapter 8 - Classes)

Page 236 CLASSES

Static initializers (§8.7) are blocks of executable code that may be used to help initialize a class.“ (JvLngSpc17 2021, Chapter 8 - Classes)

Constructors (§8.8) are similar to methods, but cannot be invoked directly by a method call; they are used to initialize new class instances. Like methods, they may be overloaded (§8.8.8).“ (JvLngSpc17 2021, Chapter 8 - Classes)


Classes in OOP: Class (computer programming), Abstract base class (ABC), Abstract class, Class body - Method body, Class browser, Class constructor (Canonical constructor, Compact canonical constructor, Normal canonical constructor, Constructor body, Default constructor, Explicit constructor invocation, Constructor modifier, Constructor overloading, Constructor signature - Method signature, Generic constructor, Constructor throw, Type of a constructor), Class declaration, Class definition, Enum class (Enum constant, Enum body declaration, Enum member), Class field (Field modifier, Static field, Transient field, Volatile field, Field initialization), Formal parameter, Class hiding (Method hiding by class methods), Class hierarchy, Class inheritance (Inheriting methods with Override-Equivalent signatures), Class initializer (Static initializer), Inner class, Class instance - Class instantiation (Class instance initializer - Preventing instantiation of a class), Class library, Class modifier, Final Class - Final method, Generic class (Generic Method - Type parameter), Class implementation file, Class invariant, Class member (Member class and interface declarations), Class methods (Method declaration, Method modifier, Native method, Method result, Method signature, synchronized method, Method throw), Nested class, Overloading (Class Overloading - Method Overloading, Constructor overloading), Overriding (Class overriding - Method overriding - Method overriding by instance methods - Method overriding by class methods, Requirements in overriding and hiding), Record class (Record components, Record constructor, Record constructor declaration, Record body declaration, Record member), Sealed class - Non-sealed class, Static method, strictfp class - strictfp method, Superclass and Subclass (Direct Subclass), Superinterface, C++ classes, C# classes, Java classes, JavaScript classes, Kotlin classes, Python classes, Ruby classes, Scala classes, TypeScript classes, Class topics. (navbar_classes – Don't confuse Course with Class here!)


Java: Java Fundamentals, Java Inventor - Java Language Designer: James Gosling of Sun Microsystems, Java Docs, JDK, JVM, JRE, Java Keywords, JDK 17 API Specification, java.base, Java Built-In Data Types, Java Data Structures - Java Algorithms, Java Syntax, Java OOP - Java Design Patterns, Java Installation, Java Containerization, Java Configuration, Java Compiler, Java Transpiler, Java IDEs (IntelliJ - Eclipse - NetBeans), Java Development Tools, Java Linter, JetBrains, Java Testing (JUnit, Hamcrest, Mockito), Java on Android, Java on Windows, Java on macOS, Java on Linux, Java DevOps - Java SRE, Java Data Science - Java DataOps, Java Machine Learning, Java Deep Learning, Functional Java, Java Concurrency, Java History,

Java Bibliography (Effective Java, Head First Java, Java - A Beginner's Guide by Herbert Schildt, Java Concurrency in Practice, Clean Code by Robert C. Martin, Java - The Complete Reference by Herbert Schildt, Java Performance by Scott Oaks, Thinking in Java, Java - How to Program by Paul Deitel, Modern Java in Action, Java Generics and Collections by Maurice Naftalin, Spring in Action, Java Network Programming by Elliotte Rusty Harold, Functional Programming in Java by Pierre-Yves Saumont, Well-Grounded Java Developer, Second Edition, Java Module System by Nicolai Parlog

), Manning Java Series, Java Glossary, Java Topics, Java Courses, Java Security - Java DevSecOps, Java Standard Library, Java Libraries, Java Frameworks, Java Research, Java GitHub, Written in Java, Java Popularity, Java Awesome List, Java Versions. (navbar_java and navbar_java_detailed - see also navbar_jvm, navbar_java_concurrency, navbar_java_standard_library, navbar_java_libraries, navbar_java_navbars)

Fair Use Sources


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


java_language_specification_java_se_17_edition_chapter_8_-_classes.txt · Last modified: 2024/04/28 03:38 (external edit)