Win a copy of Rust Web Development this week in the Other Languages forum!

Daniel Cox

Ranch Hand
+ Follow
since Nov 16, 2015
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 Daniel Cox

The JLS says that a widening primitive conversion from float to double may result in "loss of information."

A widening primitive conversion from float to double that is not strictfp may lose information about the overall magnitude of the converted value.

4 years ago

Stephan van Hulst wrote:They probably did it to reduce the amount of time that compilers need to find out what file a class description is in.

The JLS supports your insightful comment

This restriction makes it easy for a Java compiler to find a named class within a package.

For example, the source code for a public type wet.sprocket.Toad would be found in a file in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.

4 years ago

Liutauras Vilda wrote:This is how well indented and formatted code supposed to be looking like (version of given code above) :

I also indent my classes as follows:

but isn't this a matter of taste?
4 years ago

Randy Maddocks wrote:I wonder what the Uncle saw in it being an advantage for him to play left-handed.

Being a left-handed player can give you an advantage if your opponent hasn’t mastered left-handed ball spins, angles etc.
4 years ago
I always taught Nadal (the greatest clay-court tennis player in history) was left-handed. I was surprised the other day to learn that he is right-handed but plays left-handed. At an early age, his uncle taught him to play left-handed in order to give him an advantage.
4 years ago
I'm definitely not saying that Java is a bad language. I'm simply emphasizing the need to adopt best coding practices. Otherwise, horrible things can happen.  
4 years ago
It looks horrible indeed. So many horrible things are possible in Java, for example
It's up to the programmer to adopt best coding practices.

4 years ago
You’re right. System.out.println(j) will never be executed; however, the compiler allows unreachable code caused by an if block in order to allow programmers to define "flag variables" for testing and debugging.

The JLS explains why the compiler allows this.

However, in order to allow the if statement to be used conveniently for "conditional compilation" purposes, the actual rules differ.

The rationale for this differing treatment is to allow programmers to define "flag variables" such as:

static final boolean DEBUG = false;

and then write code such as:

if (DEBUG) { x=3; }

Liutauras Vilda wrote:

Daniel Cox wrote:It sounds like a demotion and not a promotion.

That isn't true.

I might be wrong since I'm not staff; I'm just a curious, nosy member of this incredibly amazing community. I would assume that a promotion gives you more privileges. I think that a Rancher has more privileges than a Ranch Foreman. For example, a Rancher has the ability to award cows.

Awarding of cows to members

Henry Wong wrote:Cows may be awarded once you obtained the title of Rancher.

4 years ago

Pete Letkeman wrote:I would be 100% fine if my title reverted back to Ranch Hand or even Greenhorn for that matter. This title does not define me in anyway that I can think of.

I assume that you're referring to Norm's enquiry. You're right, a title or cow does not define you in any way, but we humans are sensitive creatures. In this thread, you talked about how some people get sensitive when something is described as 'Easy' and 'Simple.'  I've seen people on this website absolutely lose it when cows are taken away from them. A £1000 gift has little or no impact on a millionaire's life, but he appreciates it when he receives a £1000 gift for Xmas and he feels offended when he's asked to return the gift.
4 years ago

Norm Radder wrote:I would think a promotion would be moving up a grade.  Is it a promotion going from a rancher owner (Rancher) to someone hired by a Rancher (Ranch Foreman)?

I agree. It sounds like a demotion and not a promotion. It wasn't long ago when you were announced as a bartender.

Campbell Ritchie wrote:...if you become inactive (or less active), the foreman title can disappear, but the rancher title would remain.

I wonder if a bartender title remains if you become inactive. I'm curious about this because lately, Jayesh A Lalwani has not been so active and has lost his bartender title, but Sharma Ashutosh remains a bartender despite the fact that he has been inactive for the past 4 years.
4 years ago

Norm Radder wrote:Is a Ranch Foreman (hired hand) above a Rancher (owner of a Ranch)?

Whoever has an answer to this question should kindly update this wiki.
4 years ago
Thanks for the promotion.  
4 years ago
It is true that creating a subclass instance does not create a separate superclass instance as well (as this JLS example shows - Example 12.5-1. Evaluation of Instance Creation).

However, that subclass instance can also be seen as an instance of the superclass.

The form super.Identifier refers to the field named Identifier of the current object, but with the current object viewed as an instance of the superclass of the current class.