• 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

This thread is for topics not covered by K&B 1.4 book

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Topics not Covered by K&B scjp 1.4 book

1) For modulus Operations like 26.4%4.6

assume like a%b,deduct b from a untill result is less than b.
so answer is 3.4.

2) for operations like a%b where b>a,then result is a.


3) char \u0063='\u0063'; is a legal statement

4)Float Wrapper constructor is overloaded to take double also.
i.e Float f1=new Float(3.1d);

Ranchers,now its your turn for Posting.


[ December 20, 2006: Message edited by: ramya sri ]

[ December 20, 2006: Message edited by: ramya sri ]
[ December 21, 2006: Message edited by: Barry Gaunt ]
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

char /u0063='/u0063'; is a legal statement

What other legal statements do you know for char??
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For shift operators,

16 << 5 = 16 * 2^5

16 >> 5 = 16/2^5

Can anyone tell me for >>> and also what if the 5 above in both cases is negative??
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To add,

When x is positive ~x = -(x+1)

When x is negative ~x = -x+1
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

As far as this thread goes, I think it's important to explicitly distinguish between the 1.4 exam, the 5.0 exam, and which edition of K&B you're referencing! We will take these posts very seriously because we don't want our books to be incomplete!

So far, none of the topics you've listed are on the 5.0 exam - are you thinking about the 1.4 exam?

Thanks,

Bert
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jothi Shankar Kumar Sankararaj:
...what if the 5 above in both cases is negative??


For type int, "only the five lowest-order bits of the right-hand operand are used as the shift distance... The shift distance actually used is therefore always in the range 0 to 31, inclusive."

For type long, "only the six lowest-order bits of the right-hand operand are used as the shift distance... The shift distance actually used is therefore always in the range 0 to 63, inclusive."

Ref: JLS - 15.19 Shift Operators (which also addresses >>>).

Important: Please note Bert's post above!
[ December 20, 2006: Message edited by: marc weber ]
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more addition,

-m >> x will always give -1 as the o/p.
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
too add,
A final int with in the range of -128 to 127 can be assigned to byte without any casting.but it is not in the case of a final long.
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you declare a variable static,implictly it also mean Transient.so no need to do declare a static variable as transient.

visitors don't sit tight,pls post
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So far none of this stuff is on the 5.0 exam and only a little of it is on the 1.4 exam!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic