shaan nimaz

Greenhorn
+ Follow
since May 27, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shaan nimaz

Originally posted by marc weber:
The java.lang package is imported by default, so there is no need for any import statements.

I don't understand why you're getting errors with this. As far as I can tell, these fields have been in the Short class since Java 1.1.

What version of Java are you using? And did you download this from Sun?



i am using JDK1.5 . I DONT KNOW WHY I AM GETTING ERRORS?
hii marc,
thank you for the reply. but i tried to compile your code then then it gave some errors .


Shorter.java:5: cannot find symbol
symbol : variable MIN_VALUE
location: class Short
System.out.println(Short.MIN_VALUE);
^
Shorter.java:6: cannot find symbol
symbol : variable MAX_VALUE
location: class Short
System.out.println(Short.MAX_VALUE);
^
2 errors
hi ,
i just want to get the minimum & maximum values of each signed datas.so i simply wrote a code as given below.

class A {
public static void main (String args[]) {
System.out.print(Byte.MIN_VALUE+",");
System.out.print(Byte.MAX_VALUE);
}}

but it works for byte,long & int only. not for short. if i wanna get the MIN_VALUE & MAX_VALUE for short , what do i do?
Shift operator
hi everybody,
just try 2 compile this.

class A{
public static void main(String [] args){

byte x,y,z;
x=2<<5;
System.out.println(x);
}
}

when you run the above code x will return 64. if 2<<10 then it will not run b'cos of compile time error(possible loss of precision). then i 2<<32. but this time it runs perfectly & return 2. so can anyone know why dis happen?