数据类型
线程thread
方法
Java类不能包含主方法。Java class may not contain a main method.
方法可以在类中以任何顺序声明。Methods can be declared in any order in a class.
方法的签名由方法名和参数列表组成。The signature of a method consists of method name and parameter list.
在Java中,方法不能在方法内部定义。A method can't be defined inside a method in Java.
在方法调用中列出的变量或值称为参数。A variable or a value listed in a call to a method is called an argument.
在方法头文件中定义的变量称为参数。Variables defined in the method header are called parameters.
每次调用一个方法时,系统将参数和局部变量存储在一个称为堆栈的内存区域中,该区域以后进先出的方式存储元素。Each time a method is invoked, the system stores parameters and local variables in an area of memory, known as a stack, which stores elements in last-in first-out fashion.
方法的实际参数必须在类型、顺序和数量上与形式参数匹配。The actual parameters of a method must match the formal parameters in type, order, and number.
Java允许你在类中声明具有相同名称的方法。这叫做方法重载。Java allows you to declare methods with the same name in a class. This is called method overloading.
在方法内部定义的变量称为局部变量。Variables defined inside a method are called local variables.
存根是一个简单但不完整的方法版本。 A stub is a simple but incomplete version of a method.
类class
基本要素
java类:分为data field和methods
UML(建模语言):
data field(数据域):在class中,但不在method中,是变量的一种。
对象(object):现实生活中的可以区分开的实体。有着独特标识,静态属性(state,一组数据域)和动态属性(behavior,一组方法)。
An object represents an entity in the real world that can be distinctly identified.
class(类):一组同种类型的对象,对象是类里的一个实例。可构造对象开辟内存空间。可作为data type。包含data field,构造方法,方法。
A class is a construct that defines objects of the same type.
两者关系:An object is an instance of a class.
A constructor is invoked to create an object.
抽象类和接口的区别
抽象类(存在具体概念的对象最好包装成抽象类):
1.抽象类中可以定义构造器
2.可以有抽象方法和具体方法
3.接口中的成员全都是public的
4.抽象类中可以定义成员变量
5.有抽象方法的类必须被声明为抽象类,而抽象类未必要有抽象方法
6.抽象类中可以包含静态方法
7.一个类只能继承一个抽象类
接口(只用于描述特征):
1.接口中不能定义构造器
2.方法全部都是抽象方法
3.抽象类中的成员可以是 private、默认、protected、public
4.接口中定义的成员变量实际上都是常量
5.接口中不能有静态方法
6.一个类可以实现多个接口
Spring框架
【java、javaspring】了解JavaSpring-CSDN博客
专业名词
Java language specification
Java language specification is a technical definition of the language that includes the syntax and semantics of the programming language.
Java language specification 是一种语言的技术定义,包括编程语言的语法和语义。
Java API
Java API contains predefined classes and interfaces for developing Java programs.
Java API包含用于开发Java程序的预定义类和接口。
Java JDK
Java JDK consists of a set of separate programs for developing and testing Java programs, each of which is invoked from a command line.
Java JDK由一组用于开发和测试Java程序的独立程序组成,每个程序都从命令行调用。
Java IDE
Java IDE provides an integrated development environment for rapidly developing Java programs. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface.
Java IDE为快速开发Java程序提供了集成开发环境。编辑、编译、构建、调试和在线帮助集成在一个图形用户界面中。
Java compiler
Java compiler translates Java source code into Java bytecode.
Java编译器将Java源代码转换成Java字节码
Java virtual machine
Java virtual machine is a software that interprets Java bytecode.
Java虚拟机是一种解释Java字节码的软件。