Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

prateek shaw

Ranch Hand
+ Follow
since Jun 16, 2008
prateek likes ...
Oracle Java
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 prateek shaw

Is JAX-RS support YAML ? Is JAX-RS support OpenAPI 3.0 ?
2 years ago
Hi All,

Currently i am exploring machine learning related area and i can see majority of time everyone is talking python and R.
I am not sure if java community is using java to solve machine learning related problem. Why python is used widely not java ?

Please do let me know your opinion.  

And also as community, should we not focus in this area ?

2 years ago
HI Junilu,

Thanks for reply , however i would like to know jdk logger mechanism first therefore i will explore log4j or slf4j.
I have found below link
4 years ago
Hi All,

Could someone suggest me java logging book ? Which explain end to end logging.
4 years ago

Campbell Ritchie wrote:I hope this is an exercise in working out what happens if you extend the Enum class. Enum is not designed to be extended by users, but all enums implicitly extend if.

That example class was recompile version of java class
4 years ago
Thanks for your replay. Yes forgot to asked why its return Array not Collection.

4 years ago
Hi All,

I have been working very long with java but i did not paid attention to understand java Enum behavior this point of view. This thread is not about asking question , but also share my experience which i have learned over the period.

Below is my java class.

1-What happened when we decomplied enum class

These two methods are added by java compiler automatically.

Now it is turn to ask my question , I have observed when we called values static method it created new Arrays with clone of all the enums. If i would call values method 100 times then it will return 100 new Arrays objects.
I know why java is doing this so the if any one by mistake change the value in Array it will not have impact else where.

Which mean if you call values method  again you will get the correct value.

Out put is

366712642 1829164700 2018699554 1311053135 118352462

All the properties are enum is to behave like constant , but values method work differently. I am thinking should we not have one more method which always return the same array instance irrespective of how many time this method is being called ?
This way at least we should not create unnecessarily array object. I know this is not the first time some asked this.

I feel we should have one more method which help us to get the same array object , if we want to make sure we are not breaking anything we can have one parameter which say if you want same object or behave like values method.(if you are not sure)
Please let me know your opinion.


4 years ago
Really awesome job.

You have started from zero , that is unbelievable. we appreciate your hard work.  
5 years ago

There is one typo in AmbiguousLambdaSample class example. The main method should throws IOException exception.

Hi ,

There is one extra semicolon(;) after below statement. (very very minor issue)

"Table 4.6 shows that there is a method for mapping between any stream types."

The table 4.5 has typo. In third row , column Destructive to Stream? value should be Yes. But it is No.
count method is terminal operation, which mean stream object can not be used after this call.
Yes , I think you are running code from IDE and that is reason why console value is coming null. Therefore it is throwing error.

Please try to run this from command prompt.
Yes, You are right , even i got the same issue.