码迷,mamicode.com
首页 > 其他好文 > 详细

3.1作业

时间:2016-03-03 19:28:06      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:

例3.1

class DataDemo01{
  public static void main(string[] args){
    int num = 99999999999999999999999d
  }
}

技术分享

 

例3.2

class DataDemo02{
  public static void main(String[] args){
    int max = Integer.MAX_VALUE;
    System.out.println("整型的最大值:" + max);
    System.out.println("整型最大值 + 1:" + (max + 1));
    System.out.println("整型最大值 + 2:" + (max + 2));
  }
}

技术分享

 

例3.3

public class DataDemo03{
  public static void main(String[] args){
    int max = Integer.MAX_VALUE;
    System.out.println("整型的最大值:" + max);
    System.out.println("整型最大值 + 1:" + (max + 1));
    System.out.println("整型最大值 + 2:" + (max + 2L));
    System.out.println("整型最大值 + 1:" + ((long)max +2));
  }
}

技术分享

 

例3.4

public class DataDemo04{
  public static void main(String[] args){
    char ch1 = ‘a‘;
    char ch2 = 97;
    System.out.println("ch1 = " + ch1);
    System.out.println("ch2 = " + ch2);
  }
}

 

技术分享

 

例3.5

public class DataDemo05{
  public static void main(String[] args){
    char ch1 = ‘\"‘;
    char ch2 = ‘\\‘;
    System.out.println("ch1 = "+ch1);
    System.out.println("ch1 = "+ch2);
    System.out.println("\"Hello World\"");
  }
}

技术分享

 

例3.6

public class DataDemo06{
  public static void main(String[] args){
    float num = 3.0f;
    System.out.println("两个小数相乘:"+num*num);
  }
}

技术分享

 

例3.7

public class DataDemo07{
  public static void main(String[] args){
    boolean flag = true;
    System.out.println("flag = "+flag);
  }
}

技术分享

3.1作业

标签:

原文地址:http://www.cnblogs.com/ckun/p/5239605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!