复习笔记java

基本类型
  • void
  • boolean(1-bit)
  • char (16-bit, Unicode)
  • byte (8-bit)
  • short (16-bit)
  • int (32-bit)
  • long (64-bit)
  • float (32-bit)
  • double (64-bit)
操作符
  • arithmétiques: + - * / %
  • relationnels: == (égalité) <= >= < > !=
  • logiques: ! (non) && (et) || (ou)
  • incréments: ++ --
  • opérateurs sur les bits: & | ^ ~ >> << >>> 
  • affectation: = -= += *= /=
  • conditionnel: ? et \
variable  = condition ? valeur_si_vrai : valeur_si_faux
^ = xor, ~ = no
>> conserve du signe, >>> seulement complete avec 0

结构
if else
for(;;) or for( :)
while()条件为真进入循环
do{}while();
switch(variable){case : break; default: break}

  • Déclaration
	int[] array_of_int; // équivalent à : int array_of_int[];
	int rgb[][][];
  • Création/Initialisation
	array_of_int = new int[42];
	array_of_int[0] = 3;
	rgb = new int[256][256][256];
	int[] primes = {1, 2, 3, 5, 7, 7 + 4};
  • Utilisation
	int length = array_of_int.length;//length == 42
	int integer = array_of_int[0];//integer == 3
关键词
对象复制实际是对pointer的复制
基本类型的复制是对数值的复制

声明和初始化
声明可以是父类,interface或是本身,这是表面的属性
初始化决定了对象的真实属性
在被外界使用时被看做为表面属性,执行动作时动用真实属性

encapsulation:

private, public, protected

Mot-clef Classe Package Sous-Classe Tous
public O O O O
protected O O O N
aucun O O N N
private O N N N





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值