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. 打开文件管理器Device File Explorer

    版本Android Studio3.2

  2. 吴裕雄--天生自然JAVA SPRING框架开发学习笔记:Spring声明式事务管理(基于Annotation注解方式实现)

    在 Spring 中,除了使用基于 XML 的方式可以实现声明式事务管理以外,还可以通过 Annotation 注解的方式实现声明式事务管理. 使用 Annotation 的方式非常简单,只需要在项目 ...

  3. Bean XML 配置(3)- 依赖注入配置

    Spring 系列教程 Spring 框架介绍 Spring 框架模块 Spring开发环境搭建(Eclipse) 创建一个简单的Spring应用 Spring 控制反转容器(Inversion of ...

  4. Dynamic Route Matching Vue路由(1)

    Dynamic Route Matching 动态的 路由 匹配 Very often we will need to map routes with the given pattern to the ...

  5. HDU 1576:A/B

    A/B Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submis ...

  6. oracle(5)--DQL查询语句

    DQL 数据查询语句(data query language) 1.查询条件符号: < ,  > ,  = ,    <= ,  >= ,    != ,  < > ...

  7. typeof()与Object.prototype.toString.call()

    用typeof方法只能初步判断number string undefined boolean object function symbol这几种初步类型 使用Object.prototype.toSt ...

  8. Spring注解——@Transactional

    @Transactional    用于service实现类,声明这个service所有方法需要事务管理.每一个业务方法开始时都会打开一个事务.(未完待续)

  9. idea新建java项目

    盘符下新建一个目录: 打开idea: Open -> 新建的目录: 右击目录 -> new -> module: 填写模块名 -> finish: file -> pro ...

  10. tensorflow笔记2(北大网课实战)

    1.正则化缓解过拟合 正则化在损失函数中引入模型复杂度指标,利用给w加权值,弱化了训练数据的噪声 一般不会正则化b. 2.matplotlib.pyplot 3.搭建模块化的神经网络八股: 前向传播就 ...