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

plz clear me plz i m waiting

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hi!
i m faheem and preparing java1.4exam
i m very confuse abt this code plz help me how can it complile and what happan behind it;
class A3{
public static void main(String args[]){
int a,b;
a=10;
System.out.println("The value of a is "+a);
char c='32';
System.out.println("The value of character is "+c);
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
}
}
look at this line
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
what happan this
i know abt byte its width is 255;
but we r cast it in "775"
and it is complie and give answer is 7 on this line
and abt one more if we cast it in it 255 it give them a answer 1
and if i put it in 256 it give 0
i m also confuse abt it
is it's width is 256 not 255
and i think it is count 0 also with counting 0 it is not possilbe plz help me
am i right or not
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic