Veena Pointi

Ranch Hand
+ Follow
since Jun 20, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Veena Pointi


public String format(TemporalAccessor temporal)
Formats a date-time object using this formatter.
This formats the date-time to a String using the rules of the formatter.

Parameters:
temporal - the temporal object to format, not null
Returns:
the formatted string, not null
Throws:
DateTimeException - if an error occurs during formatting



API says This formats the date-time to a String using the rules of the formatter.Can I know where can I read rules of he formatter and also in what scenarios it throws DateTimeException.Any resources to read will be of great help . I want to improve my confidence of answering date formatting questions.

Thanks,
Veena
Thank you so much for clarification.
char c=’a’;  c=c+1; gives compile error.Where as c++ compiles fine and prints b !

Trying to understand what is the difference .Is pre increment operator doing automatic casting from int to char like compound assignment operator +=?

Thanks,
Veena


Answer is Immediately after line 10.

But shouldn't the answer be after line 4? Because temp is local variable and local variables go out of scope after method exits ,becoming eligible for garbage collection.

Thanks,
Veena
Thank you everyone .I was able to get help by calling them .
Oh! I don't know how did I miss to read this ,although I thoroughly read few times. Thank you very much Ron.

Adrian Grabowski wrote:When you login through this url do you see your book there?



Yes I see my book here.
Thank you for replying.It didn't help. When I try to redeem accesscode it displays below message
This access code cannot be redeemed because you already have an active subscription for this product.
Hello,

I am not able to find 3 practice tests that sybex book OCA  Study Guide by Jeane Boyarsky and Scott Selikoff promises . Can someone please help me find where they are located? They not inside the book.On the link that they mentioned,they only have flash cards and quizes.

Thanks,
Veena



The above code prints
Krishna
Inside String method

I umderstand StringBuilder has it's own toString method so it calls that method and prints Krishna . I am trying to find out what triggers calling of toString method. println method calls toString method on the argument that is passed ? I checked API .println method actually calls Strin.valueOf methos on the argument that is passed. Can someone explain and trace how exactly toString method is called ?

Thanks,
Veena
Below is explanation of OCA by Jeanne Boyarsky and Scott Selikoff for sequence of executiong of for statement

1.Initialization statement executes
2.If booleanExpression is true continue,else exit loop
3.Body executes
4.Execute updateStatements
5.Resturn to step 2

So you see i=0 happens only once.As per this explanation both code blocks above should output same thing that is print 1 2 3 4 . Why in case of infinite loop , i is being initialized to 0 everytime and why not in other case?



Output of above code is infinite loop



Output of second code block is
0
1
2
3
4

Can someone please explain why the difference of output although they both seem to be doing same thing?

Thank you,
Veena
I am so sorry .My mistake in mapping line numbers from book .It is actually line 23.