8-6Win7+Linux+Java

Win7

  1. 查看|显示|创建|删除目录/文件
    dir
    tree
    md linyi16
    md student.txt
    rd|deltree student.txt

  2. 创建|删除|复制文件
    cd. > a.txt(空白文件)
    del -[f删只读|s删目录及其下的所有内容|q删除前不确认]
    copy 源文件 目标文件
    【copy a.txt b.txt:会新建一个b.txt将a.txt中的内容复制到其中】

  3. type (显示文本文件的内容)
    cls (清屏幕)

  4. ipconfig(本机ip地址、子网掩码、默认网关等)

  5. ping www.baidu.com(查看网络连接)

  6. exit(退出)

Linux命令

  1. ll所有权限
    ls所有目录
    pwd 当前所在目录
    cd 打开
    mkdir linux

  2. 查看
    more
    tailf a.txt(显示正在往里写的内容)
    tail -f 100 a.txt

  3. 查询
    find [-name] “a.txt”
    locate “a.txt”

  4. 进程
    ps -ef | grep java[条件]查看进程
    kill -9 9585 结束进程

  5. 历史命令
    history

  6. start restart status stop

//[root@localhost linux]# service network status
已配置设备:
lo ens33
当前活跃设备:
lo ens33 virbr0

//[root@localhost linux]# service network stop
Stopping network (via systemctl): [ 确定 ]

//防火墙的4种状态s r s s
[root@localhost linux]# service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.

  1. date日期
    改时间date -s 12:30:12
    改日期date -s 20190807

  2. su lf切换成普通用户

  3. cp a.txt b.txt
    cp /usr/local/linux/a.txt …
    scp 第一个文件的目录 第二个的目录 [两虚拟机之间的传输]

  4. rm -rf a.txt [直接删除不提示]

  5. mv a.txt test/ [移动文件]
    mv a.txt test.txt [改名]

  6. chmod 705 test.txt[更改权限]

JAVA

  1. 简单编译
	public class Hello {

		public static void main(String[] args){		
			System.out.println("===>大家好!");
			System.out.println("===>JAVA编译后执行的结果");
			System.out.println("===>JAVA Development is very easy");
		}
	}

在这里插入图片描述

  1. 快捷键:
    注释单行: ctrl+/
    反注释单行:再一次ctrl+/
    注释多行:ctrl+shift+/
    反注释单行:再一次ctrl+shift+/
    删除单行:ctrl+D

  2. 标识符:[a-z|A-Z|_|$|¥][0-9a-zA-Z]

不可以用关键字和保留字
无长度限制
大小写敏感
1)类名+接口名:首字母大写,其余小写 SamDoc
2)方法名和变量名:首字母小写,其余大写 findUserById
3)包名:字母全小写com.abc.dollapp
4)常量名:采用大写形式,单词之间以下划线隔开

  1. 关键字
    abstract break byte boolean catch case class char continue default double do else extends false final if for float import int implements(实现接口) interface long native new null package private protected public return等等等等

  2. 类型
    8个基本类型:byte8 boolean8 double64 long64 float32 int32 char16 short
    空类型:null
    引用类型: 类class、接口interface、数组 【String a[]=""; int[] Array=;】
    String

  3. 数据类型
    常量
    变量

  4. 类型转换的几个Demo

public static void main(String[] args) {
		// char类型
		char ch1, ch2;
		ch1 = 'A';
		ch1++;
		ch2 = 'B';
		// System.out.println("ch1 and ch2 ===>" + ch1 + " & " + ch2);
		// System.out.println("ch1 ++  ===>" + ch1);

		// int类型
		int numi = 6;
		for (int i = 0; i < numi; i++) {
			// System.out.println(i);
		}

		// boolean类型
		boolean flag;
		String yuju = "This is a juzi!";
		if (yuju.length() == 0) {
			flag = false;
			// System.out.println(flag);
		} else {
			// System.out.println(yuju);
		}

		// long类型
		long l = 9000000000000000000L;
		int longParse = (int) l;
		// System.out.println(longParse);

		// double类型
		double d = 9.999999;
		float f = 8.99999f;
		int doubleParse = (int) d;
		int floatParse = (int) f;
		// System.out.println(doubleParse);
		// System.out.println(floatParse);

		// byte类型
		byte b;
		int num1 = 123;
		float f1 = 123.666f;
		double d1 = 23.3;
		b = (byte) f1;
		System.out.println(b);
	}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值