小编jag*_*gh5的帖子

O(O(f(n)))是什么意思?

我对Big-Oh表示法有所了解.但是我如何解释O(O(f(n)))的含义呢?这是否意味着增长率的增长率?

big-o asymptotic-complexity

2
推荐指数
1
解决办法
978
查看次数

实例化和声明分开

我的问题是关于Java中的声明和值分配规则。在编写字段时,我们可以一起声明和分配值,但是我们不能单独进行相同的操作。

例如:

class TestClass1 {
    private int a = 1;
    private int b ;
     b= 1;
    private int sum;

    public int getA() {
        return a;
    }

    public int getB() {
        return b;
    }

    public int getSum() {
        sum = a + b;
        return sum;
    }

}

public class TestClass {
    public static void main(String[] args) {
        TestClass1 testClass1 = new TestClass1();

        System.out.println("total =" + testClass1.getSum());
    }    

}    
Run Code Online (Sandbox Code Playgroud)

在这里:

private int a = 1; 
Run Code Online (Sandbox Code Playgroud)

我们可以将a声明为私有int并为其分配值1。但在以下情况下:

private int b ;
b= 1; …
Run Code Online (Sandbox Code Playgroud)

java declaration assign

1
推荐指数
1
解决办法
382
查看次数

标签 统计

assign ×1

asymptotic-complexity ×1

big-o ×1

declaration ×1

java ×1