当前位置:网站首页>2.28 (defect filling) data type conversion exception handling part multi threading
2.28 (defect filling) data type conversion exception handling part multi threading
2022-06-12 03:52:00 【weixin_ forty-five million four hundred and twenty-one thousand】
Type conversion :
1. The string type is converted to a concrete basic type
The string type is converted to a concrete basic type Convert through the method of the wrapper class corresponding to the data type
Integer: Wrapper class 、 Packaging
int Basic data type -------- object type ( Reference type ):Integer

2. Convert basic data type to string type

summary :
Basic data type Conversion between basic data types :
..................byte-short-int-long-float-double
Reference type conversion :
Subclass to parent Direct conversion
Parent class to child class Coercive transformation Could cause an exception (instanceof Operator judgment )

exception handling :
throws: Declaration exception Must be used in the method ; Indicates that there may be an exception ( Could happen , It may not happen )
throw:throw Throw an exception explicitly It's in the body of the method Once thrown , It means that the process interrupts from the throw point , The rest of the code does not execute
A method that declares an exception is called , This calling method requires try...catch Or declare an exception



The superclass constructor declared an exception , Subclass constructors must declare exceptions ( Greater than or equal to parent class )

Method rewrite , Subclasses override methods of the parent class , And subclasses declare exceptions , Then the parent class must declare an exception ( Greater than or equal to subclasses )


All access modifiers in an interface cannot be private:

The properties in the interface are constants

final Modify properties Constant.
final decorator , Always class ( Cut off children and grandchildren ) All methods in the representation class have final modification
final Modification methods
Do not want to be overridden by subclasses , Business rules are absolutely consistent
final Modified class , Can't be inherited ; final The method of decoration , Can't be rewritten ;

Multithreading :

There are two threads to print odd and even numbers respectively :
sleep Don't fit , Just let the naked eye see that it meets the conditions


Out-of-service Thread.sleep Alternate threads .
In fact, it is disorderly , Need to communicate with threads () To realize alternate printing of two threads .

边栏推荐
- Detailed explanation of data platform SQL development and function use
- [C language] dynamic memory allocation
- MongoDB精华总结
- R语言plotly可视化:plotly可视化分组(grouped)小提琴图(grouped violin plot in R with plotly)
- 如何修改mysql 查询出来的结果名称 结果1,结果2
- Mosaïque d'images basée sur la matrice de transformation
- 数据库精选 60 道面试题
- Three ways for ORALCE to process column to row conversion and finally generate table style data
- 3769 moving stones (simulated)
- 顺序表与链表---初阶
猜你喜欢

How to modify the result name of MySQL query result 1 and result 2

Database selected 60 interview questions
![[C language] dynamic memory allocation](/img/ac/ba3882c76f93dde0ab0d5294c5b6d9.jpg)
[C language] dynamic memory allocation

KV storage separation principle and performance evaluation of nebula graph

Three ways for ORALCE to process column to row conversion and finally generate table style data
![[data recovery in North Asia] data recovery in which the logical volume of the server is changed and the file system is damaged due to system reinstallation](/img/7f/ad628a45bec0ac9a5586d743ca0310.jpg)
[data recovery in North Asia] data recovery in which the logical volume of the server is changed and the file system is damaged due to system reinstallation

Data flow diagram of Flink

Detailed explanation of data platform SQL development and function use

Drop down menu dropdown yyds dry inventory of semantic UI

分布式计算的八大谬论
随机推荐
[C language] dynamic memory allocation
Mosaïque d'images basée sur la matrice de transformation
Double objective learning materials sorting
动规(15)-最低通行费
Will subsequent versions support code block search highlighting
[C language] encapsulation interface (addition, subtraction, multiplication and division)
R语言plotly可视化:plotly可视化分组(grouped)小提琴图(grouped violin plot in R with plotly)
KV storage separation principle and performance evaluation of nebula graph
[Clickhouse column] user initialization of new library role
[untitled]
php和js去掉所有空格
动规(14)-三角形最佳路径问题
Hacker + marathon =? Hacker marathon?
CA證書及密鑰對應用筆記
R语言write函数:使用write函数将数据写入RStudio控制台、write函数将数据写入新的Rstudio窗口(启动新的窗口)
Experience the good team collaborative development process brought by Huawei cloud code hosting from 0 [my Huawei cloud experience journey] [play with Huawei cloud]
【FPGA+FFT】基于FPGA的FFT频率计设计与实现
Sequence list and linked list ----- advanced
Sed command
R语言plotly可视化:可视化回归模型实际值和回归预测值的散点图分析回归模型的预测效能、区分训练集和测试集、一个好的模型大部分的散点在对角线附近、添加边缘直方图以快速诊断模型可能存在的任何预测偏差