Home  >  Article  >  Java  >  What does class mean in java

What does class mean in java

little bottle
little bottleOriginal
2019-05-22 18:20:1915251browse

class means "class" in java and is the keyword to define a class. If you define a class, you need to modify it with this to let Java know what you want to write, whether it is a class or a method; for example, "public class A(){}" defines a class A, and "public A() {}" will be considered a constructor.

What does class mean in java

#In the java world, everything is an object. In a sense, Java has two kinds of objects: instance objects and Class objects. The runtime type information of each class is represented by a Class object. It contains information about the class. In fact, our instance objects are created through Class objects.

The keyword class is used in Java to define a class. Its basic form is as follows:

public class 类名{
       //定义属性部分(成员变量)
      类型1 属性1;
      类型2 属性2;
       //定义方法部分
       方法1;
       方法2;
}

class is a class in java. If you define a class, use this to modify it, so you can Let Java know what you want to write, whether it is a class or a method.

For example, public class A(){} defines a class A, and public A(){} will be considered a constructor.

The above is the detailed content of What does class mean in java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn