scjp

    1热度

    3回答

    public class Operator { public static void main(String[] args) { byte a = 5; int b = 10; int c = a >> 2 + b >> 2; System.out.print(c); //prints 0 } } 当5右移2位时是1,右移

    0热度

    1回答

    我无法在这里输入我的代码,因为stackoverflow错误messge,但我有一个疑问,我可以扩展我的innerabstract类,我创建一个抽象类内,现在我想抽象的内部类到我声明的具体类的外部抽象类。

    -3热度

    1回答

    的PrintStream write()重载PrintStream的方法 print() PrintStream的重载方法 的PrintWriter write()重载的PrintWriter的方法 print() PrintWriter的重载方法 我不明白如果write()方法和print()方法做同样的事情(写入文件),那么为什么这两个名称是在这些类中定义的?

    -1热度

    1回答

    我感到困惑与以下,任何人都可以请帮我这个: - 为什么StringBuilder的给了我一个更新后的字符串时,我使用追加而不是当我使用字符串。下面是一个例子: - class Hello{ public void doSomething(){ StringBuilder sb = new StringBuilder("animals"); sb.append("s"); System.

    1热度

    1回答

    嗨我正在SCJP转储,但现在我有一个问题。这里是问题: void waitForSignal(){ Object obj = new Object(); synchronized(Thread.currentThread()){ obj.wait(); obj.notify(); } } 哪一种说法是正确的? A.此代码可以抛出一个Int

    -2热度

    1回答

    任何人都可以帮助我解决以下问题吗? public class Starter extends Thread{ private int x=2; public static void main(String[] args) throws Exception{ new Starter().makeItSo(); } public Starter(){

    1热度

    1回答

    我正在研究线程优先级,我有Windows 10和Ubuntu 16.0 lts操作系统。 而且我知道windows并没有提供基于优先级的处理,所以我看不到基于优先级的线程程序的使用,以至于它如何工作。 因此,我在ubuntu上运行基于优先级的程序,因为有人告诉我ubuntu提供基于优先级的进程。 但当我运行我的程序时,它显示相同的输出或混合输出作为窗口。 那么有什么办法可以在Ubuntu中启用优先

    0热度

    2回答

    这里的输出是SCJP转储一个问题: public class Threads1 { int x=0; public class Runner implements Runnable{ public void run(){ int current=0; for (int i=0; i<4; i++){ current

    3热度

    1回答

    为OCPJP 6考试做准备(这就是为什么我使用Java 1.6编译器)我注意到了我对Java泛型的一些不清楚。 考虑下面的代码: class A<K extends Number> { public <V> V useMe1(A<? super V> a) { // OK return null; } public <V> V useMe2(A<? e

    -5热度

    5回答

    public class ClassA { public void count(int i) { count(++i); //throws StackOverFlowError } public static void main(String[] args) { ClassA a = new ClassA();