I can get the unique id like className@2345 of my object by calling its toString() method, but after I overwrite the toString() method, how can I get that unique id?
I have a third party object which uses the toString method inherited from java.lang.Object. This method is pretty useless. However I can't think of a clean design to override ...
Hello, Someone knows why the java compiler throws the following error: "toString() in java.lang.Object is not defined in a public class or interface; cannot be accessed from outside package" I mean toString() is a public method from object so is there by default. I am running JSDK 1.4.2 on windows xp import com.company.*; => this is the import clause at the ...
thanks for responding. No, i dont use public fields. i guess i should have said i want to write a deepToString for a java bean, in which all accessible properties are in turn deepToString'ed. I've heard of reflection, and thiink i understand the concept, but am not sure where to start with that.
Yeah, you're wrong. The whole point of SimpleDateFormat is to allow you to convert between Dates and Strings. Although maybe I'm misunderstanding what you mean by "linked". Of course, the real solution is to keep a reference to the original Date object, rather than turning it to a String and back again (if possible).
As with most things, there are at least two schools of thought on that. In general, I don't make methods final unless I specifically don't want them overridden. Some people feel you should declare them final by default, and only remove the final in cases where there are specific reasons to override them. Neither is right or wrong. It's mostly a ...
Most probably that is because at the present time I am in a situation where most of my time is spent waiting for a call from the customer, and the app I am supporting works so well that those calls are few and far between. Lucky for me, they pay me for sitting around and answering questions on a forum.