This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes why is 'unsigned' not supported in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "why is Watch "why is New topic
Author

why is 'unsigned' not supported in java

Lakhsmi V B Kanduri
Greenhorn

Joined: Oct 01, 2007
Posts: 1
can anyone please let me know why is the following code not working fine?

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


signed int x = 10;
for (int y=0; y<5; y++, x--)
System.out.print(" " + x);
}
}
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35250
    
    7
Welcome to JavaRanch.

The title of your post contains the answer to your question: Java does not have "signed" and "unsigned" keywords. byte, short, int and long are by definition signed.


Android appsImageJ pluginsJava web charts
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9950
    
    6

Java is not C.


Never ascribe to malice that which can be adequately explained by stupidity.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: why is 'unsigned' not supported in java
 
Similar Threads
LOCAL VARIABLE
a question about static clause
Inner class question from Dan's exam
static variables
Why does x=x++ cause infinite loop?