zoukankan      html  css  js  c++  java
  • 作业

    第二题:
    1.描述JRE是什么?作用是什么?
    运行环境 运行
    2.描述JDK的是什么?作用是什么?
    开发工具 java程序开发
    3.描述JVM是什么?作用是什么?
    java虚拟机 跨平台
    4.简述JRE、JDK、JVM的区别是什么?
    JRE是java的运行环境,
    JDK是java的开发工具包,
    JVM则是让java能够在任何平台运行的虚拟机

    第三题:
    1.简述什么是java中的关键字
    2.关键字的特点
    1.小写
    2.变色
    3.举出至少5个java中常见的关键
    public class static void int

    第四题:
    以下选项中的标识符中,哪些是合法的(ACEGH)
    A: username 1
    B: 123username 0 数字开头了
    C: username123 1
    D: class 0 关键字
    E: user_name 1
    F: 98.3 0 数字开头了
    G: _username 1
    H: HelloWorld 1
    I: $ username 0 空格不是组成部分


    第六题:
    byte b1=3,b2=4,b;
    b=b1+b2; //byte + byte = int
    //b = (byte)(b1+b2);
    b=3+4;
    哪句是编译失败的呢?为什么呢?
    b=b1+b2; //byte + byte = int 这句话错误,应该使用int类型字符串

    第七题:
    找出下列代码中出错的地方,并将其改正.
    public class Test01 {
    public static void main(String[] args) {
    int a; //int a = 0;
    System.out.println(a); //没赋值直接使用
    {
    int c = 20;
    System.out.println(c);
    }
    c = 30;//c取不到值 int c = 30;
    System.out.println(c);//c取不到值
    }
    }

    public class Test02 {
    public static void main(String[] args) {
    byte b = 3;
    b = b + 4;//需要强转 b = (byte)(b+4); b+=4;
    System.out.println("b=" + b);
    }
    }


    public class Test07 {
    public static void main(String[] args) {
    int x = 2;
    {
    int y = 6;
    System.out.println("x is " + x);
    System.out.println("y is " + y);
    }
    y = x; //y取不到值 int y = x;
    System.out.println("x is " + x);
    }
    }
    改正:public class Test07 {
    public static void main(String[] args) {
    int x = 2;
    {
    int y = 6;
    System.out.println("x is " + x);
    System.out.println("y is " + y);
    }
    int y = x; //y取不到值
    System.out.println("x is " + x);
    }
    }

  • 相关阅读:
    向你的C语言项目中加入多线程
    <解析>speaker verification模型中的GE2E损失函数
    【笔记】 springCloud-configServer配置中心
    springboot--ActiveMQ--消息队列
    Fdfs上传的图片批量删除
    【笔记】负载均衡Robbin之不同服务使用不同的策略
    【笔记】Ribbon负载均衡伪随机算法
    【笔记】01 -- Spring-Cloud介绍
    linux防火墙
    SpringBoot起飞系列-使用idea搭建环境(二)
  • 原文地址:https://www.cnblogs.com/dmmm/p/13792553.html
Copyright © 2011-2022 走看看