Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!

Sha Jar

Greenhorn
+ Follow
since Mar 02, 2010
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 Sha Jar

Rob Prime wrote:Why don't you try out?



Because the compiler may be wrong.

The Java language specification rules.
9 years ago

Momen Travolta wrote:why doesn't the same result appear in C programs.



They do, unless they're hidden by rounding.

This problem is not programming language specific, it's fundamental to number systems: Using a finite representation, not every number in one number system can be exactly represented in another number system. The conversion errors you've noted are a result of that.
9 years ago

Faraz Alig wrote:
Not very sure if I had understood the concept of static variable /methods but the below piece of code is causing some trouble.



Anything static is what you really would like not to be part of an object if Java would allow you to.
9 years ago

David Newton wrote:I'll remind you again about the JavaRanch naming policy. Please change your display name to conform with this policy. Thanks!



I already did. It was Tasha first so I changed to Natashia.

By the way David Newton I really enjoyed your show,

http://www.davidnewton.co.za/
9 years ago

Henry Wong wrote:The Random class no-arg constructor actually uses the system time as the initial seed,



Not anymore, because of the problems associated with it.

Since Java 6 you're guaranteed a random sequence that's "very likely to be distinct from any other invocation of this constructor" which is much better.
9 years ago

malaya nayak wrote:
i am unable to be sure about whether the classes are in association or aggregation or composition or dependancy only..



Post the definitions of those words here. Then consider each example and suggest which you consider to be closest to each definition.
9 years ago

Gangadhararao Bommasani wrote:
However, Is there a way to handle key/value without depending on collection Framework?



No.

Just kidding. Of course there is. Just start developing your own.
9 years ago

jerry washington wrote:but I dont understand the purpose of this? or what is this useful for?



It allows you to write general code. If you write your code using supertype variables the code will work with objects of any subtype.
9 years ago

Yeddu Prabhakara Rao wrote:is a GENERIC variable as it can be casted to any required type .



The term generic variable doesn't exist in Java.

The meaning you've assigned to it is arbitrary.
9 years ago

Steven Rodeo wrote:I am I missing some thing ?.



Maybe you've missed that what determines whether a key is already present in a HashMap is the equals method alone.

The hashCode method is used only as an aid to the HashMap in its efforts to store the entries efficient internally.

So equals and hashCode have two distinct and very different purposes. Equals guards the HashMap from multiple entries. HashCode helps the Hashmap with the internal organization.
9 years ago

lAmit Joshi wrote:
5. Why abstract classes are faster than interface?



It's because abstract class methos are found faster in an object at runtime than interface methods.
9 years ago

lAmit Joshi wrote:5. Why abstract classes are faster than interface?



It's because abstract class methods are found faster in an object at runtime than interface methods.
9 years ago
Do you think OpenGL has a future in Java?
9 years ago

Henry Wong wrote:Anyway... I could see the last post fueling a bit of a religious debate -- it definitely "pushed" it a bit more than other posts. Please be careful. This topic is interesting. Or it can get to the point where it will be deleted.



It's my post you mean right.

Well I thought the OP asked for personal experience so I gave mine.

I'm not trying to impose my view on anybody else though. Everybody thinks and does what they want.
9 years ago

Jacob Sonia wrote:[code]
Which is considered good coding skills?



The general rule is that a method should return a value of a specific type.
9 years ago