Santhosh Raje

+ Follow
since Sep 26, 2006
Merit badge: grant badges
For More
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 Santhosh Raje

Hi All,
Can anyone explain me about both
17 years ago
Hi Anth,
As you know the default delimiter is white space for a Scanner.
So when you pass the String which in this case is a single word,the scanner.hasNext method returns true for the first time so it goes inside the loop and prints the value using next() method.
After this when it goes into second time this time the while(false) since there is no other word present in the string ...

Hope this explains you something
Hi Marcin,
Congratulations for a Great Score.
Can you tell me How much is this Whizlabs ,Is it Free or If Payable How much dollars i need to pay.

17 years ago
Since the final variable inside the method is a constant whose value is not going to be changed ,Hence even if there are multiple instances of Inner class objects the value of this variable is not going to be changed.
Hi Sai,
The Final Reference Variable which is pointed to String array object is not changed.So no error occurs.Since I dont know how the for each method is internally implemented I cant say anything beyond this.
Hi Ankit,
You are right that "Assertions are disabled by default" .
So During runtime of the code if they are not enabled then there wont be any output.
If assertions are enabled then the output will be an Assertion Error.
Here there are two methods one takes short while other one takes float,
Since we passed a int value ,the method with float argument is taken and printed float.
Since For Short you know that 16 bit is the range while for float it is 64bits.
Assigning Wider Conversion is allowed ,while Narrowing the conversion then we need to use casting for it.
Here After line 10 ,the CardBoard objects at line 9 becomes eligible for Garbage Collection since c2 is made to point to null while calling in method go().
At line 11 ,the CardBoard object present in line 8 becomes eligible.
Hence two cardboard objects becomes eligible for Garbage Collection.

I dont understand why Short object story becomes elligble for Garbage collection.
Hey ,
Just some input on what I know on Greedy Quantifiers is that
The Source:yyxxxyxx and the Pattern:*.xx
Here the Pattern is matched for this particular source.
What happens during matching is the Condition is that From the source match for tokens that end with xx.
So the JVM can interpret as yyxx as one token or yyxxx as another token and last xyxx as another token(Totally:3)
While the actual number of tokens what we expect is 2.

So they kept the name as Greedy Quantifiers