【java】java知识点集合

本文详细介绍了Java编程的基础知识,包括数据类型、线程和方法的使用。强调了Java类与主方法的关系,方法的声明和调用规则,以及参数和局部变量的概念。同时,讲解了类、对象、数据域和行为的基本概念,对比了抽象类与接口的区别,并提及了Java开发工具如JDK、IDE和编译器的作用。最后,简要提到了Spring框架在Java开发中的重要性。
摘要由CSDN通过智能技术生成

数据类型

数据类型

线程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字节码的软件。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

岩塘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值