Grant Olde

Greenhorn
+ Follow
since Jun 29, 2009
Merit badge: grant badges
For More
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 Grant Olde

Jesper Young wrote:"Old Grantonian" - Please check your private messages, as Maneesh and I asked you before.



Hi Jesper and Maneesh

Sorry for all the hassle about my name.

As I already mentioned to Maneesh, my first name is Oldridge. This was the name of my late mother's late father. Since my first day at school, I've been called "Old"

I get comments such as "Are you young or old, young Old?"

Will it be OK if I change my personal details from "Old" to "Oldridge", or do I need to choose a completely different fake name?

Best regards,
Old
.
14 years ago
Thanks to Maneesh and Jesper

I expect to get the hang of this by 2012 (next leap year)
14 years ago
I'm a "leap-year" dabbler in java (every 29th February). Each time I come back to java, I have to relearn "this"

There are many code examples on the use of "this". For example:
http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html

The problem with the examples is that they show the correct use of "this", but they don't say what would happen if you didn't use "this"

I think it might help me if someone could make a statement such as:

If you want result X, then you must use "this". But if you want result Y, then don't use "this". If you want result Z, then it doesn't matter whether or not you use "this".

Therefore, I would be most grateful if someone could give me two very short pieces of code that I could run in Eclipse.

One piece of code would use "this", and the other would not. I can then use single-stepping to examine what happens with and without "this"

I would prefer if the sample code did not refer to a constructor, so that I can get the simple stuff in my mind first (if ever!)

Of course, if some kind person wants to provide *four* tiny runnable code examples (two pieces that are not for a constructor, and two pieces for a constructor), then I would be delighted. Killing 4 birds with "this" stone
14 years ago

Peter Johnson wrote:I use CTRL-SHIFT-F
Under the Source menu there is a Format item



That works great! Thanks
I have Eclipse Galileo.

When I import source code to Eclipse, is there a quick way to reformat the imported code so that it looks like code that is created within Eclipse?

I'm referring to position of braces, indentation, and other features that are set in:
Windows > Preferences > Java > Code Style > Formatter