zoukankan      html  css  js  c++  java
  • 9.18号作业 朱丽1636050061

    /*程序员:朱丽

    1、输出一个长整型的变量*/

    public class Long
    {
      public static void main(String[] args)

        {
        long L=123456789012345L;
        System.out.println(L);
        }
    }

    //    2、输出一个单精度的小数常量

    public class Float
    {
      public static void main(String[] args)

        {
        float f=7.7f;
        System.out.println(f);
        }
    }

     //   3、输出一个布尔类型的变量

    public class Boolean
    {
       public static void main(String[] args)

        {
        boolean b=true;
        b=false;
        System.out.println(b);
        }
    }

    //  4、强制类型转换

    public class Byte
    {
      public static void main(String[] args)

        {
        byte b=7;
        b=(byte)(b+200);
        System.out.println(b);
        }
    }

    //   5、输出一个字符型的加法运算

    public class Sum
    {
      public static void main(String[] args)

        {
        System.out.println((char)('你'+1));
        }
    }

     //  6、演示变量的溢出结果

    public class Overflow
    {
      public static void main(String[] args)

        {
        int l=0xaaaaaaa;
        System.out.println(l);
        }
    }

     //  7、算术运算符+-*/

    public class SumChar
    {
      public static void main(String[] args)

        {
        int x=20;
        x=x/2*100;
        System.out.println(x);
        }
    }

  • 相关阅读:
    python常用字符串处理(转)
    Python读写文件基础.py
    Python异常和调试.md
    Python类的进阶.md
    Python模块和类.md
    python函数基础:调用内置函数&定义函数
    Spring.Net学习笔记(二)-数据访问器
    Spring.Net学习笔记(1)-容器的使用
    Spring.Net学习笔记(0)-错误汇总
    VS中设置xml智能提示
  • 原文地址:https://www.cnblogs.com/zhuli-1/p/7553895.html
Copyright © 2011-2022 走看看