简体   繁体   English

Java中的“类”是预定义的类吗?

[英]Is “class” is predefined class in Java?

Can we say that java.lang.Class is predefined class in Java? 我们可以说java.lang.Class是Java中的预定义类吗?

I am really confused on this.. I am new to Java so I am not sure. 我对此很困惑。我是Java的新手,所以我不确定。 So please let me know the correct answer. 因此,请让我知道正确的答案。

Class is a class where as class is a keyword. Class是类,其中class是关键字。

  • Type java.lang.Class 键入java.lang.Class

    Instances of the class Class represent classes and interfaces in a running Java application. 类Class的实例表示正在运行的Java应用程序中的类和接口。

  • Keyword class ( JLS Chapter 8 ff. ) 关键字classJLS第8章及以后

    Class declarations define new reference types and describe how they are implemented 类声明定义了新的引用类型并描述了它们的实现方式
    [...] [...]
    A class declaration specifies a new named reference type. 类声明指定一个新的命名引用类型。

Class java.lang.Class . java.lang.Class Class objects contain runtime representations of classes. 类对象包含类的运行时表示形式。 Every object in the system is an instance of some Class, and for each Class there is one of these descriptor objects. 系统中的每个对象都是某个Class的实例,并且对于每个Class,都有一个描述符对象。
A Class descriptor is not modifiable at runtime 类描述符在运行时不可修改

Declaration 宣言

public final class Class<T> extends Object
implements Serializable, GenericDeclaration, Type, AnnotatedElement

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM