java练习题

import java.util.Scanner;

public class HHR{
  public static void main(String[] args){
    long l=123456789012345l;
    System.out.print("长整数的的值是:"+l+"\n");

    float f=2.4f;
    System.out.print("单精度的小数是:"+f+"\n");

    boolean b=true;
    b=false;
    System.out.print("布尔型变量的值是:"+b+"\n");

    byte c=3;
    c=(byte)(c+200);
    System.out.print(c);

    System.out.print((char)('a'+1)+"\n");
    System.out.print((char)('你'+1)+"\n");

    int e=Integer.MAX_VALUE+1;
    System.out.print(e);

    @SuppressWarnings("resource")
    Scanner input=new Scanner(System.in);
    double t;
    System.out.print("Enter the x "+"\n");
    t = Double.valueOf(input.nextDouble());
    t=t/1000*1000;
    System.out.print("The calculation result is " + t +"\n");


  }
}

 

posted @ 2017-09-25 10:31  黄浩然  阅读(84)  评论(0编辑  收藏  举报