This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!

C Bryant

Greenhorn
+ Follow
since Mar 29, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 C Bryant

Don't understand why I should need a cast in this case?

Seems like the Calendar should be smart enough to know that it has a clone() method. I would have expected start.clone() to return an object of type Calendar, not of type Object.
6 years ago
later dude. work to do.
6 years ago
Eclipse Indigo running Java 1.6 with Java 1.5 compliance on a Mac.

Seems like we are splitting hairs. The syntax shouldn't be that fragile.

So, if I stand on my head, and touch my right elbow, and hold down the Shift key . . . .
6 years ago
Sure, that's cool, and simpler, too. Thanks!

Only the second one doesn't compile?

How about these three?



01. Compiles, albeit with an "unchecked conversion" warning.
02. Does not compile.
03. Cut and pasted from the JavaDocs 1.6 API does not compile.

What gives? I want to assign to a List, because I do not want to write to implementation classes. I want to code to interfaces. Stooges, indeed!!
6 years ago
Yes well, that was sort of the point of the example. The code looks like it should work to me. It makes logical sense syntactically.

Why should there be a two step process? 1. Create the String array. 2. Convert the array to a list? Why can't I do this all in one statement?
6 years ago
But, not the following?

6 years ago