int a = 5000;
float b = 13.65f;
byte c = 0x4a;
public class Test{

   public static void main(String args[]){
Integer x = 5;
x = x + 10;
System.out.println(x);
}
}
public class Test {
public static void main (String []args)
{
System.out.println("90 度的正弦值:" + Math.sin(Math.PI/2));
System.out.println("0度的余弦值:" + Math.cos(0));
System.out.println("60度的正切值:" + Math.tan(Math.PI/3));
System.out.println("1的反正切值: " + Math.atan(1));
System.out.println("π/2的角度值:" + Math.toDegrees(Math.PI/2));
System.out.println(Math.PI);
}
}

public class Main {
public static void main(String[] args) {
double[] nums = { 1.4, 1.5, 1.6, -1.4, -1.5, -1.6 };
for (double num : nums) {
test(num);
}
} private static void test(double num) {
System.out.println("Math.floor(" + num + ")=" + Math.floor(num));
System.out.println("Math.round(" + num + ")=" + Math.round(num));
System.out.println("Math.ceil(" + num + ")=" + Math.ceil(num));
}
}

吴裕雄--天生自然 JAVA开发学习:Number & Math 类的更多相关文章

  1. 吴裕雄--天生自然 JAVA开发学习:Scanner 类

    import java.util.Scanner; public class ScannerDemo { public static void main(String[] args) { Scanne ...

  2. 吴裕雄--天生自然 JAVA开发学习:String 类

    public class StringDemo{ public static void main(String args[]){ char[] helloArray = { 'r', 'u', 'n' ...

  3. 吴裕雄--天生自然 JAVA开发学习:Character 类

    char ch = 'a'; // Unicode 字符表示形式 char uniChar = '\u039A'; // 字符数组 char[] charArray ={ 'a', 'b', 'c', ...

  4. 吴裕雄--天生自然 JAVA开发学习:正则表达式

    import java.util.regex.*; class RegexExample1{ public static void main(String args[]){ String conten ...

  5. 吴裕雄--天生自然 JAVA开发学习:变量类型

    public class Variable{ static int allClicks=0; // 类变量 String str="hello world"; // 实例变量 pu ...

  6. 吴裕雄--天生自然 JAVA开发学习:异常处理

    try { // 程序代码 }catch(ExceptionName e1) { //Catch 块 } import java.io.*; public class ExcepTest{ publi ...

  7. 吴裕雄--天生自然 JAVA开发学习:文档注释

    /*** 这个类绘制一个条形图 * @author runoob * @version 1.2 */ import java.io.*; /** * 这个类演示了文档注释 * @author Ayan ...

  8. 吴裕雄--天生自然 JAVA开发学习:序列化

    public final void writeObject(Object x) throws IOException public final Object readObject() throws I ...

  9. 吴裕雄--天生自然 JAVA开发学习: 泛型

    public class GenericMethodTest { // 泛型方法 printArray public static < E > void printArray( E[] i ...

随机推荐

  1. Swift 协议protocol

    // associatedtype 关键字 用来声明一个类型的占位符作为协议定义的一部分 protocol LXFViewModelType { associatedtype Input associ ...

  2. Python MongoDB 创建集合

    章节 Python MySQL 入门 Python MySQL 创建数据库 Python MySQL 创建表 Python MySQL 插入表 Python MySQL Select Python M ...

  3. java基础源码 (4)--reflect包-AnnotatedElement接口

    接口:AnnotatedElement * Represents an annotated element of the program currently running in this * VM. ...

  4. robotframework+selenium2Library怎样不用手动关掉代理

    每次跑脚本,启动浏览器都要手动关掉代理,太费劲了,发现最简单的办法就是在局域网设置里面勾上跳过本地地址的代理服务器,并且在例外里写上127.0.0.1 就这么简单有没有??

  5. LeetCode刷题(持续更新ing……)

    准备刷题了!已经预见未来的日子是苦并快乐的了!虽然 N 年前刷过题,但现在感觉数据结构与算法的基本功快忘光了

  6. RPC——看这一篇就…显然不够

    引言 RPC blablabla…… RPC 知识点 扩展 有给老婆解释的如:https://www.jianshu.com/p/2accc2840a1b

  7. CentOS下的安装命令 安装Nginx 更新yum源 kali系统当中的软件管理命令(第五天)

    Linux下软件的安装:方式:yum/rpm/源码安装YUM安装(帮助管理员解决依赖关系):yum search mysqld 在源中搜索软件包yum install mysql-connector- ...

  8. 2,The AudioContext was not allowed to start.

    The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on t ...

  9. 编写软件动态加载NT式驱动

    NT式设备驱动程序的动态加载主要是由服务控制管理程序(Service Control Manager,即SCM)系统组件来完成的. Windwos服务可以在系统启动时加载,用户也可以按需在服务控制平台 ...

  10. python counter、闭包、generator、解数学方程、异常

    1.counter 2.闭包 3.generator 4.解数学方程 5.异常 1.python库——counter from collections import Counter breakfast ...