Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Naveen Bachu

Greenhorn
+ Follow
since Feb 12, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Naveen Bachu

It's still mislabeled as "the best way" at best, falsely advertised at worst. Don't use that method, even with synchronization. There are better ways.



I didn't get what is wrong with the code, except synchronization, Can you guide us to any best example to compare and improve our knowledge?
9 years ago
This will still work by adding synchronized block
9 years ago
This implementation seems to be very poor, we create Singleton class so that no one should be able to create two instances Note: this rule is also applicable for the person who is writing this class

Here is the example which explains about implementation of Singleton class: Best Way to Create Singleton Class
9 years ago
Ishan Pandya is correct, either you can use normal for loop or foreach to iterate all the elements of the arraylist.

Here is the example for your reference How to Use ( Java ) For Loop with ArrayList
9 years ago