It's a little trick because if you use add with a position it will be wrong..
in the order they were added (first in first out)
class MyClass{
public static void main(String []args) {
int i = 100;
byte b = (byte)i;
System.out.println(b);
}
}
Thread-1, 5 and main represent the thread's name, priority and thread group respectively.
class DoubletoHexString {
public static void main(String[] args) {
Double a = new Double(Double.NaN);
System.out.println("a: " + a.doubleValue());
System.out.println("doubletoHexString: " + Double.toHexString(a.doubleValue()));
}
}
public class StartInThreadAndRunable extends Thread implements Runnable {
StartInThreadAndRunable(){
}
StartInThreadAndRunable(Runnable r) {
super(r);
}
public void run() {
System.out.println("Thread or Runnable?" + this);
}
public static void main(String[] args) {
Runnable r = new StartInThreadAndRunable();
Thread t2 = new StartInThreadAndRunable(r);
t2.start();
}
}
Output: Thread or Runnable? Thread[Thread-1,5,main]
SUN will never unrecognized any certified candidates.
The >> operator only works on the number of bits in the primitive type. Because 270 is an int it only has 32 bits. The shift value is modded by 32 (shift%32).