当前位置:网站首页>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 .

边栏推荐
- hash function
- UI consistency design of products
- 魏武帝 太祖知不可匡正,遂不复献言
- JSP implementation of bank counter business performance evaluation system
- 动规(15)-最低通行费
- [MySQL] MySQL installation
- C language array
- Computer configuration suggestions for learning modeling
- Batch automated e-mail: Vika Vige table x Tencent Qianfan scene connector has made new moves, and business communication and event marketing only need 3 steps
- Notes relatives à l'application du certificat de l'AC et de la paire de clés
猜你喜欢

mysql/oracle 以唯一时间为分界,小于等于该时间求和,大于该时间求和

Domestic mobile phones are snubbing low-end consumers, and Nokia provides them with high-quality products

Naive Bayes classification of scikit learn
![[Business Research Report] forward looking report on urban renewal and development in China in 2021 - download link attached](/img/5d/15615ad26dc3dbb10b0b9de8813848.jpg)
[Business Research Report] forward looking report on urban renewal and development in China in 2021 - download link attached

The memory four area model of C language program

魏武帝 太祖知不可匡正,遂不复献言

怎样拥有心灵的平和?获得一颗全新的心灵

MongoDB精华总结

Steamvr--- grab objects
![[C language] encapsulation interface (addition, subtraction, multiplication and division)](/img/8f/1351826a6f7e83ce90d32d7615adc1.png)
[C language] encapsulation interface (addition, subtraction, multiplication and division)
随机推荐
【C语言】封装接口(加减乘除)
sed命令
电商中台系统架构
根据变换矩阵进行图像拼接
Community Conference | the mosn community will release version 1.0 and promote the evolution of the next generation architecture
简单的数据库连接示例
成功解决:WARNING: There was an error checking the latest version of pip.
PyTorch中的Sequential、ModuleList和ModuleDict用法总结
DS18B20数字温度计 (一) 电气特性, 供电和接线方式
[Clickhouse column] user initialization of new library role
hash function
ics-07
Solution to missing in unity script
Final summary of addition, deletion, modification and query - 2.1 (single table - addition, deletion, modification and query)
数据库精选 60 道面试题
分布式计算的八大谬论
Youcans' opencv lesson - 10 Image restoration and reconstruction
Data flow diagram of Flink
Page crash handling method
Three ways for ORALCE to process column to row conversion and finally generate table style data