包:全部小写,以域名开头;
类名字:第一个单词首字母大写,后面的单词首字母大写;
包:全部小写,以域名开头;
类名字:第一个单词首字母大写,后面的单词首字母大写;
public class Hellor
经常使用多多练习
ctal+z 撤回
一.题目1 12
2. 12
3. 12
4. 6
1. 1、2、3、4
2.BDGH
3.byte short int long float double char
4.byte short int long
5.public class Student{
public static void main(string[] args){
}
}
notepad 记事本
mspaint 画本
calc 计算器
dwatgawtga
dawll
Tab 四个空格,在编程中一般用来缩进格式
回车 用来换行
win+R 打开运行窗口
char[] c = {'A','B','C'};
for(int i = 0; i <c.length; i + +){
System.out.println(c[i]);
}
4.
Scanner scan = new Scanner(System.in); int a,b,c; System.out.println("请输入三个整数"); a= scan.nextInt(); b= scan.nextInt(); c= scan.nextInt(); if (a>b){ int d =a; a=b; b=d; } if (b>c) { int d = b; b = c; c = d; } if (a>b){ int d =a; a=b; b=d; } System.out.println(a+" "+b+" "+c);
5.
1.
import java.util.Scanner; class h{ public static void main(String[] args){ int scan = new Scanner(System.in).nextInt(); if (scan%2 != 0){ System.out.println(scan+"是奇数"); }else if (scan%2 ==0&&scan!=0){ System.out.println(scan+"是偶数"); } } }
2.
int x = 1; for (int a=1;a<=5;a++){ x=x * (a+1); } System.out.println(x);
3.
long finalx = 0; int x=1; for (int b =1;b<=5;b++) { for (int a = 1; a <= b; a++) { x = x * (a + 1); } finalx +=x; } System.out.println(finalx);
4.
int x =5; y=6; z;
z=++x (6)+ y++(6/7)=12
z=++x (7)+ x++(7/8) =14
x= ++x (9)+ x++(9/10)=18
z=x>y?++x : y++ =19
dos命令
d :切换盘符
dir :列出当前目录所有文件
md :创建文件夹
rd :删除文件夹
cd :打开文件夹
tab :自动补全
. 当前目录 .. 上一个目录
cd \或者 cd\ 退回到根目录
del a.txt del *.txt
del 目录 表示删除目录下的所有文件
DOS命令。
循环语句
while循环
while(布尔表达式){
//循环体
}
do..while循环
do{
//循环体
}while(布尔表达式);
for 循环
for(初始化语句;判断条件语句;更新语句){
//循环体
}
byte占一个字节范围:-128-127
short占两个字节范围:-32768-32767
int占四个字节范围:-2147483648-2147483647
long占八个字节范围:
注:以上都是整数类型
浮点类型:float占四个字节范围
double占八个字节范围
switch分支语句
结构:
switch(表达式){
case值1:
语句块1;
break;
case值2:
语句块2;
break;
。。。。。。
default:(当所有条件都不满足时,就执行此语句)
语句块;
break;
}
表达式可以是整数字符枚举字符串
case后面的值必须是常量
break用来中断switch 语句