Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
how can it be byte?
Venkat Ramsimha
Ranch Hand
Posts: 127
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
switch (i)
{
default:
System.out.printIn("Hello");
}
how can it be said that "byte" is the acceptable type for the variable i in the above program?
Shalini Chandel
Ranch Hand
Posts: 115
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Because switch can only evaluate the data type
int
and any type that can be promoted to an
int
i.e.
byte, short, char, and int
SCJP 1.4
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to read binary file?
BufferedImage from byte[]
Xml Element to Byte Array
convert long to byte ?
Convert byte to its hex format?
More...