常用DOS命令

按win+R件打开任务资源管理器

dir 显示文件目录,默认C\users\

cls 清屏

cd 更换目录

cd .. 返回上级目录

cd .acmx到达名为.acmx的目录

cd \ 直接回到根目录

退出:exit

切换硬盘

c:

d:

e:

f:

复制内容 :鼠标右键

子目录树: tree c: 显示所有c盘子目录树

tree d:显示所有d盘子目录树。

相对路径与绝对路径:

相对路径:从当前目录开始定位,形成的路径。

绝对路径: 从根目录或者说顶级目录开始定位,形成的路径。

其他DOS指令 涉及Linux

md 创建目录md+FileName

rd 删除目录 rd+FileName

echo 添加内容到文件,没有文件会自动创建一个文件 echo hello > hello.txt

del 删除文件和文件内容 del+FileName (不能对目录进行操作)

copy FileName1 e:\ Filename2 将文件一内容复制到文件2中

move FileName1 e: \Filename2 将文件一内容移动到到文件2中

第一个java程序:

准备:安装jdk 8u,配置系统环境变量,配置vscode 插件,创建hello.class,创建hello.java

public class hello {
    public static void main(String[] args) throws Exception {
        System.out.println("Hello, World!");
    }
}

My second java program: a input output system.

base on what users input ans output the choice users make;

first output the menu:
1.welcome to this system, may you have fun!

2. if you input 1 with keyboard, weather of today is rainy else is sunny;

3. if you input 1 wiht keyboard ,we know you are  male ,else you are female.

4.if the temperature you input exceeds 30 you will get the tip "the temperature of today is so high",else is "the temperature is too low";

then output "program ended!".

public class hello{
  public static void main(String []args){
    java.util.Scanner  s=new java.util.Scanner(System.in);
   System.out.println("welcome to this system,where you may have  fun");
   System.out.println("1 rainy 2 sunny");
   System.out.println("1 male  2  femail");
   System.out.println("temperature");
   System.out.print("please input the weather of today!");
   int weather=s.nextInt();
   String str="rainy";
   if(weather==2) str="sunner"; 
   System.out.print("the weather of today is ");
   System.out.println(str);
   System.out.print("please input the sex of you:");
   int sex=s.nextInt();
   String str2="male";
   if(sex==2) str2="female";
   System.out.print("your sex is ");
   System.out.println(str2);
   int temp=s.nextInt();
   if(temp>30){
     System.out.println("the temperature of today is so high");
   }else {
    System.out.println("the temperature of today is too low");
   }

   System.out.println("program ended");

  }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

litian355

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值