栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

常用DOS命令

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

常用DOS命令

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

dir 显示文件目录,默认Cusers

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");

  }
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/972985.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号