Faisal syed

Ranch Hand
+ Follow
since Mar 25, 2011
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Faisal syed

Yes Mike. Thanks for the clarification Joel, that helped
8 years ago
Hi Folks,
Below is the snippet of code


I thought the first print statement would print "newString" as String is an object, and when we pass objects between methods, changing state of the object in any method reflects across the methods. Please correct my understanding
8 years ago
Hi Friends,
I have a DAO class which is spring managed. I need to decide whether to use static/non-static methods. I believe using non-static methods will force callers of the DAO to wait until it is fully initialised, and is the better option, since you have a fully formed class. please let me know what are the factors that I must consider before deciding?
8 years ago
Thinking of null as an unknown value, that cannot be resolved, how come one unknown can be equal to another unknown?
8 years ago
package corejava;

public class ArgumentResolver {

public static void method(String s){
System.out.println("string");

}

public static void method(Object o){
System.out.println("object");

}
public static void main(String[] args) {
method(null);

}

}


--
output is string. Please explain this
8 years ago
Hi Ritchie,

yes. I also meant mapping.

[There is a much simpler way to do such arithmetic, using chars only. ]
Could you give an example please ?
9 years ago
I get the fact that I need to have a map.
I realise we can do arithmetic, but the results would be different.

char 'a' + 'b' = 99// not 3

Thanks
Faisal
9 years ago
Is it that we need to traverse through all the ascii values, and lookup until we find a match ?
9 years ago
There is a constraint that this needs to be done without wrapper classes
9 years ago
Hi Friends,

Can you guide me on how to add 2 characters say a= '1' , b = '2' to yield a 3 (Not 99 ie 49 + 50; the ascii values)?

Thanks
Faisal
9 years ago
True. It was an interview question posed at me.
9 years ago
Hi Friends,
I understand that objects stay on heap, and methods on stack.
However, Consider a local method



Can someone please explain me for how long this obj lives.
Once the method exits, will the obj disappear off the heap as well??

Thanks
Faisal
9 years ago
Hi Jeff/Rob,
Thanks for the help. I have another query.
When I only need a shallow copy of the object, it is fair enough to use the clone functionality
provided by java.lang.Object, and not override the clone() method myself. Is this correct?

Thanks
Faisal
9 years ago
Hi Friends,
Please help me on this.

9 years ago
Many thanks for your patience. You helped me finally put the topic to rest
9 years ago