File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes char problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "char problem" Watch "char problem" New topic

char problem

Kunal Choudhary

Joined: Feb 25, 2009
Posts: 14
public class testoperator

public static void main(String args[])

char x='51';



why error???
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374

I think you are trying to achieve ,
char x=51; // This is equivalent to 3 (ASCII)

'51' can't fit into single character.
I agree. Here's the link:
subject: char problem