Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Gaurav Raje

Ranch Hand
+ Follow
since Jul 23, 2010
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 Gaurav Raje

Shiny Suresh wrote:

I have written something like this. Could you please help me with this? Thanks for your prompt response.

Shiny Suresh.

For starters, you might want to use the enhanced for loop instead of the regaular i ++ kinds i think. Otherwise, you are only adding empty cssvallists to the new list

7 years ago
Also I dont get your question. I thought you wanted to implement a queue. I dont see any interface or methods for it
7 years ago
Does it work the way you expected it to? Instead of asking is this correct, its better to ask a more specific question like, "I expected ___ and got ___"
7 years ago
In the long run, you might want to consider reading

I lovced this book. It will start from the concepts and take you to some intermediate level stuff. Though, in any case, the best teacher is to do a project.
7 years ago
I had a profesor, who used to say, static is the opposite of abstract... just to emphasise this exact point...

While not entirely true, it helps if you think this way.
8 years ago

Soumyajit Hazra wrote:Thanks Jeff. I do searched it in google and found that in Template Design Pattern,Factory Pattern we are using abstract classes. Please correct me if I am wrong. I mainly want to get the differences between interface and abstract class from design pattern point of view. I understand its a very general question but I'll be great full if anyone pick any one pattern and give me some explanation w.r.t that pattern only.

You can search this forum for this question. It has already been answered. But just to add,
Abstract class defines something concrete, which is the parent of a particular object, but is too vague to be instantiable.

Animal(Abstract)-> Person (abstract) -> Man/Woman (concrete). These classes can have certain behaviors(in the form of methods) defined, but lack certain others, which stop them from being concrete

Interfaces are merely a collection of behaviors which a particular class must exhibit in its own way. Eg Swimmable, Breathable.

The hierarchy in abstract classes is linear. Where as, in interfaces, we can group two unrelated classes based on some common behavior.
8 years ago
I believe you can use JNDI to connect to LDAP. I have not done this myself, so I would like to invite someone else to build on this.
8 years ago
imho, go will be a totally new language... quite different from java. So if you want to branch off, go can be an answer. But if you want to build on what you already know, go is a lil out of the way.
8 years ago
personally, i find the whole Google App Engine quite promising given the fact that they just moved over from beta to prod. But that is just me. That can act as a base for other applications (services) which you might develop, like say android apps.
You will also get a small introduction to GWT while learning it.
8 years ago
another gotcha
if you are using packages

make sure the class is present in your/package/fully/qualified/name/folder
again classpath tutorials should explain it.
8 years ago
Technically, if its working fine you are fine.
From a design perspective,
I know there are many theories floating around, about whether to implement or not. I usually use the approach -> if there is a specific reason why I shouldnt, I dont. Otherwise, I do.
Especially if some other class in the future uses this class (Which in your case may not happen).
But again, thats my opinion.
8 years ago

Campbell Ritchie wrote:Why have you got a Manager field in the Manager class? That looks mistaken to me.

Do you mean to have a hierarchy? like a manager has a manager..
8 years ago
Thinking in Java was good for me... I believe it is available for free on bruce eckels website (some edition)
8 years ago

Maneesh Godbole wrote:

Gaurav Raje wrote:You might also want to check the import statements. I have had cases where the eclipse auto import messed up my actual imports

In that case, the code wouldn't compile in the first place, not throw an exception at runtime

Sorry my bad for explaining it poorly.
I was talking in particular about eclipse. Suppose if you are using a class called Date(strictly an arbitrary example) . which is present in both, java.sql.Date as well as java.util.Date. So while compile time, there are cases where, eclipse in its infinite wisdom converts the import statements from one to the other. So if you have a
Date d = new Date() // expecting to use java.util.Date, sometimes the import statement is converted to

Now if you have java.sql.Date on your classpath in eclipse, it shows no compilation error. And you have no idea that in reality you need the java.sql.Date on your classpath. But when you run it, without having java.sql.Date on your classpath, you get the noClassDefFoundError.
You doublecheck to ensure that java.util.Date is present.

May be it was just me who faced this issue, but its more of an IDE fault than anything else.
8 years ago