• 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

integer/integeral type?????

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to Marcus Green exam ::3
Q no -24
Which of the following statements are true??.
1) The following statements will produce a result 1.
System.out.println(-1 >>> 2);
2)Performing and unsigned leftshift (<<<) on negative number will always produce negative number result.

3)The following output will produce a result of zero,
System.out.printlln(1>>1);
4) All integer premitive in java are signed numbers.

The answer given is only 3. I aggred that 3 is right but why not 4 ???.
If incase of integer if they mentioned integral then its ok, but integer primitive are byte,short,int,long.
Please correct me if i'm wrong ???
Thanx

sp.
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi sp,
char is included in integer primitive. & it is signed .so option 4) is wrong.
regards
deekasha
 
reply
    Bookmark Topic Watch Topic
  • New Topic