标签:整数 lan 文件 ext 字符 src private throws --
dir 查看目录下文件
cd /c d:\ 文件切换目录
cd ... 返回上一级目录
cls 清除窗口的记录
exit 退出CMD
ipconfig 查看TCP/IP配置的值
ping 可以测试网络
md 新建文件夹
rd 删除文件
cd>name.text 新建文件
del 删除文件
public class HelloWord{
public static void main(String[] args) {
System.out.println("Helo,Word!");
}
}
break |
||||
case |
const | |||
continue | default | do | double | else |
enum | extends | final | finally | float |
for | goto | if | implements | import |
instanceof | int | interface | long | native |
new | package | private | protected | public |
return | strictfp | short | static | super |
switch | synchronized | this | throw | throws |
transient | try | void | volatile | while |
true | false | null |
//整数
int i = 10;
byte b = 20;
short s = 30;
long l = 40L;
//小数,浮点数
float f = 50.1F;
double d = 3.14159265358979;
//字符 单引号
shar name = ‘A’;
//字符串
String name = "Right-A";
//布尔值
boolean T = true;
boolean F = false;
public class Demo04 {
//属性:变量
//实例变量:从属于对象:如果不自行初始化默认值为 0 0.0
//布尔值默认值为:false
//除了基本类型,其他的默认值为 null
String name;
int age;
//类变量 static
static double salary = 2500;
//main方法
public static void main(String[] args) {
//局部变量:必须声明初始值
int i = 10;
System.out.println(i);
//变量类型
Demo04 Demo04 = new Demo04();
System.out.println(Demo04.age);//默认值 0
System.out.println(Demo04.name);//默认值 null
//类变量 static
System.out.println(salary);
}
//其他方法
public void add(){
}
}
public class Demo05 {
//修饰符,不存在先后顺序
static final double PI = 3.14;
final static double PO = 3.14;
public static void main(String[] args) {
System.out.println(PI);
System.out.println(PO);
}
}
public static void main(String[] args) {
int a = 10;
int b = 20;
System.out.println(a + b); //30
System.out.println(a - b); //-10
System.out.println(a * b); //200
System.out.println(a / (double) b); //0.5
}
public static void main(String[] args) {
//++ -- 自增 自减 一元运算
int a = 3;
System.out.println(a); //3
int b = a++;
System.out.println(b); //3
int c = ++b;
System.out.println(c); //4
//工具类Math
double pow = Math.pow(2, 3);
System.out.println(pow);
}
public static void main(String[] args) {
long a = 1235153215321L;
int b = 123;
short c = 10;
byte d = 5;
System.out.println(a+b+c+d); //1235153215459
System.out.println(b+c+d); //138
System.out.println(c+d); //15
}
public static void main(String[] args) {
int a = 10;
int b = 20;
int c = 32;
System.out.println(c % b);
System.out.println(a > b); //false
System.out.println(a < b); //true
System.out.println(a == b); //false
System.out.println(a != b); //true
}
public static void main(String[] args) {
//与(and) 或(or) 非(取反)
boolean a = true;
boolean b = false;
// 逻辑与运算:两个变量都为真,结果为true
System.out.println("a && b :" + (a && b)); //a && b :false
// 逻辑或运算:两个变量有一个为真,结果才为真
System.out.println("a || b :" + (a || b)); //a || b :true
// 如果是真,则变为假,如果是假则变为真
System.out.println("!(a && b) :" + !(a && b)); //!(a && b) :true
//短路运算
int c = 5;
boolean d = (c < 4) && (c++ < 7);
System.out.println(d); //false
System.out.println(c); //5
}
public static void main(String[] args) {
/*
A = 0011 1100
B = 0000 1101
A & B = 0000 1100
A / B = 0011 1101
A ^ B = 0011 0001
~ B = 1111 0010
2*8 = 16 2*2*2*2
<< *2 左移
>> /2 右移
0000 0000 0
0000 0010 2
0000 0100 4
0000 1000 8
0001 0000 16
*/
System.out.println(2 << 3); //16
}
public static void main(String[] args) {
//x ? y : z
//如果x==true, 则结果为y, 否则结果为z
int score = 80;
String type = score < 60 ? "不及格" : "及格";
System.out.println(type); //及格
}
public static void main(String[] args) {
int a = 10;
int b = 20;
a += b; //a = a+b;
a -= b; //a = a-b;
System.out.println(a); //10
//字符串连接符 + ,String
System.out.println("" + a + b); //1020
System.out.println(a + b + ""); //30
}
com.Right.operator.
package com.Right.operator;
import com.Right.operator.Demo01;
阿里巴巴Java开发手册
无规矩不成方圆,无规矩不能协作
package com.Right.base;
/**
* @author Right
* @version 1.0
* @since 1.8
*/
public class Doc {
String name;
/**
*
* @param name
* @return
* @throws Exception
*/
public String test(String name) throws Exception{
return name;
}
}
javadoc -encoding UTF-8 -charset UTF-8 Doc.java
学习中的一些笔记
标签:整数 lan 文件 ext 字符 src private throws --
原文地址:https://www.cnblogs.com/Right-A/p/13269660.html