It's not a secret anymore!*
The moose likes Beginning Java and the fly likes Reading a char from int Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Reading a char from int" Watch "Reading a char from int" New topic

Reading a char from int

Stephen Foy
Ranch Hand

Joined: Oct 17, 2005
Posts: 143
I have a loop in my program that runs only when the value is != q

The probelm is the data type is int. How can i work with this?

Stephen Foy - Microsoft Application Development Consultant
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704

Char and int are considered the same format based on length, so you can convert fairly easily such as:

My Blog: Down Home Country Coding with Scott Selikoff
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Reading a char from int