Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why is 'unsigned' not supported in java

 
Lakhsmi V B Kanduri
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12196
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is not C.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic