George Charitonidis

Greenhorn
+ Follow
since Apr 05, 2019
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by George Charitonidis

When using this simple code snippet:

I get the correct color, when using the default "Metal" Look and Feel:



But I get no color with "Nimbus":



And no color with "Windows" as well:



Any idea why this happens and how can I fix it?

Thank you in advance!
1 month ago
OK, but... they are both declared locally. If we have Object o, instead of Object o = new Object(), then:

args instanceof Object > true

o instanceof Object > compiler error: not initialized

So in what way is args different than Object o? Are method parameters treated somehow differently? Isn't args initialized (as an Object) when main() is called?
3 months ago
Given:

How many objects do we have when reaching the comment "No of objects"?

In simple OCA tests the answer is one.

But in my opinion, the objects (OK, references to objects) are two: args and t.

So what's true? Which answer should we give if someone asked this question? Doesn't args count as an individual object? Or am I missing something?



3 months ago