File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes why is 'unsigned' not supported in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
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: 42263
    
  64
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.


Ping & DNS - my free Android networking tools app
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11398
    
  16

Java is not C.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why is 'unsigned' not supported in java