zoukankan      html  css  js  c++  java
  • 黄宗禹9.18作业

    1./**功能:输出一个长整型的变量 123456789012345
    */
    public class Long{ public static void main(String[] args) { long l=123456789012345l; System.out.println(l); } }


    2./**功能:输出一个单精度的小数常量 2.4
    */

    public class Float{ public static void main(String[] args) { float f=2.4f; System.out.println(f); } }





    3./**功能:输出布尔类型的变量
    */
    public class Boolean{
       public static void main(String[] args)
       {
           boolean b=true;
           System.out.println(b);
    b=false;     System.out.println(b); } }
    
    

    4.

    public class Byte{
       public static void main(String[] args)
       {
           byte b=3;
    	   b=(byte)(b+200);
    	 System.out.println(b);	   
       }
    }

    5./**功能:输出字符型的加法计算
    */

    public class Sop{
       public static void main(String[] args)
       {
            System.out.println((char)('a'+1));
            System.out.println((char)('你'+1));
       }
    }

    6./**功能:演示变量的溢出效果

     */

    public class Max{
       public static void main(String[] args)
       {
    		int i=Integer.MAX_VALUE+1;
    		System.out.println(i);
       }
    }

    7./**功能:给x赋值,进行x=x/1000*1000的计算并输出结果

    */

    import java.util.Scanner;
    public class Math{
       public static void main(String[] args)
       {
            Scanner input=new Scanner(System.in);
    		double x;
    		System.out.println("Enter the x ");
            x = Double.valueOf(input.nextDouble());
    		x=x/1000*1000;
    		System.out.println("The calculation result is " + x);
       }
    }

     
     
  • 相关阅读:
    html表单提交的几种方法
    ORACLE-SQLLOAD导入外部数据详解
    js 技巧1
    js 细节
    问题链接
    abstract 抽象类
    修饰符 public、 private 和 protected和区别
    HTML5新特性之Mutation Observer
    img 标签上的src 链接图片不存在时 怎么处理
    npm 用 淘宝代理
  • 原文地址:https://www.cnblogs.com/huangzongyu/p/7545423.html
Copyright © 2011-2022 走看看