This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Veena Pointi

Ranch Hand
+ Follow
since Jun 20, 2002
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

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.

temporal - the temporal object to format, not null
the formatted string, not null
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.

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 +=?


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.

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.

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.


The above code prints
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 ?

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

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

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