Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best Java Memory Aid Contest

 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Create a killer Java memory aid and win a copy of our new cert book. (That is, when *we* ever get *our* copies!
Bert and I will give away two copies of our new cert book, for the best two Java memory aids. It can be anything that helps you remember/recall/retain/understand something you're likely to forget about Java. You can use a poem, a rhyme, an acronym, a mnemonic -- whatever.
Here are the rules:
1) MUST be related to Java, and be within the scope of what is on the SCJP (can't be about servlets or EJB, for example).
2) CAN be about even a very beginning Java topic - - anything about the language, or any API covered on the exam, is acceptable.
3) Must be in English (sorry, that's all we can really understand)
4) By posting one here, you are automatically granting Bert and I permission to use it in our upcoming book (from O'Reilly, coming in April). [we will acknowledge you in the book if we do use yours]
5) We'll make the decision on January 8th, so you better have it posted by January 7th. You can post as many as you want, of course
6) You can't win BOTH books, so even if you have what we all agree are the two best, you'll still only get one book, and the second book will go to the next best one not submitted by you.
Bert and I will judge them, but we can be influenced by what other people think of them. So if other folks here really like one -- even if we have another favorite, we're more likely to choose the one that everybody else here likes.
Here are some silly examples:
"Roses are red, violets are blue,
Extend only one, but implement two"
"Roses are red, this poem is choppy,
Passing-by-value means passing-by-copy"
Or, to remember the primitive variables:
Be Careful, Bears Shouldn't Ingest Large Furry Dogs
(boolean, char, byte, short, int, long, float, double)
OK, you can see why we need help...
Have fun!!
- Kathy and Bert
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Kathy forgot to mention that we are open to other forms of bribery...
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hey Kathy,
I generally use this phrase to remember the operator precedence phrase.
Just a simple way of remembering operator precedence:
Undoubtedly, AstronautS Really Love The Astronomy.
Unary +, -, ++, --
Arithmetic and shift *, /, % ,+ , -, <<, >>
Relational >, <, >=, <=, ==, !=
Logical&&, ||, &, |, ^
TernaryA > B ? X : Y
Assignment=, *=, /=, +=, -=
 
Deep Chand
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I forgot to give the explanation (in case it is not clear).
Undoubtedly - Unary
AstronautS - Arithmetic and Shift
Really - Relational
Love - Logical
The - Ternary
Astronomy - Assignment
This is killer. Right
Cheers,
Deep
 
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Cool!
Too bad I don't have Memory Aid, especially in English. But I will stick to my reading business. And who knows, I may come up with a winner!
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This is really a very good approach, Kathy and Berts. But don't you think that time is too short?
[ December 31, 2002: Message edited by: Prosenjit Banerjee ]
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I frequently got confused about the two right shift operators. I couldn't remember which among them is Signed and which is Unsigned. At last I found a way :
Length of the word "SIGNED" is smaller than that of "UNSIGNED". And, length ">>" is also smaller than ">>>".
So,

">>" - signed right shift
">>>" - unsigned right shift


[ December 31, 2002: Message edited by: Prosenjit Banerjee ]
[ January 02, 2003: Message edited by: Prosenjit Banerjee ]
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
OK - you guys are on the right track! If you are the only entrants, then you will win by default!
-Bert
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have made following aid to help me memorizing the primitive java types. They are in their appropriate order:

bull runs fast
chair doesn't run
boat is short, isn't ship long?
ship when floats water doubles


Here is the explanation. Pronounce "Boolean" as "Bull" and "byoate" as "boat".

boolean runs fast
chair doesn't run
byoate is short, isn't ship long?
ship when floats water doubles


[ January 02, 2003: Message edited by: Prosenjit Banerjee ]
[ January 03, 2003: Message edited by: Prosenjit Banerjee ]
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi friends,
I have very poor memory. So, I had to write the memory aid (although I don't know whether it will at all aid others ) like the following. I am very poor in English. So, I tried my best.
This is a list of Java keywords. I have reffered JLS 2nd edition.

THIS is the FINAL day FOR "CATCH NATIVE Dogs" PACKAGE led by SHORT haired SUPER of municipality Mr. FLOAT Peterson, commonly known as STRICTFP since he is an INSTANCEOF the CLASS of CHARacters that are very strict about their jobs. He always strictly IMPLEMENTS the CONSTitutional rules and laws and says, "I never be a DEFAULTer. IF in CASE I fail to DO my job everybody ELSE will TRY to insult me". WHILE driving aLONG the PUBLIC road with a NEW IMPORTed PRIVATE van, called BOOLEAN (since it runs like a bull ), INTernally PROTECTED by a DOUBLE-door VOID cage and equipped with modern INTERFACE of SYNCHRONIZED electronic SWITCHes and air-BREAK, he finds two dogs on the road. He EXTENDS his hands to THROW some pieces of meat. The dogs GOTO BYTE the pieces. Suddenly, he THROWS some VOLATILE and TRANSIENT liquid through the window and they look ABSTRACT, stand STATIC and FINALLY collapse. Strictfp, catches the dogs and RETURNs to CONTINUE his job.


Keywords are bolded only at the first occurance.
Read this paragraph once everyday and it will surely help you tackle questions like "Which of these are keywords?".
[ January 02, 2003: Message edited by: Prosenjit Banerjee ]
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I ASSERT that deserves a prize for sure! 6.0 outta 6.0!
-Barry
[ January 01, 2003: Message edited by: Barry Gaunt ]
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Well this one is for remembering how the compiler converts primatives when doing arithmetic operations:
"Don't Forget Little Issac"
Basically it is just the first letter of each word for to help remember these rules:
D (double) - If either type is double, then the other is converted to double
F (float) - Else, if either type is float, then the other is converted to float
L (long) - Else, if either type is long, then the other is converted to long
I (int) - Else, both types are converted to int
lance
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
WOW !!!
These are great !! Now we're talking !!
Man oh man!! Unbelievable !! Keep 'em coming !! Yeah ! Hooray !!
You guys rock !!
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Often people do not manage to remember whether protected access is more or less restrictive than the "default" (friendly) access.
The following sentence enumerates the access modifiers from the most to the less restrictive.
Private investigators default to protect public goods.
I'm not sure the sentence makes much sense, but, well, whatever...
[ January 02, 2003: Message edited by: Valentin Crettaz ]
 
Lance Titchkosky
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Here is one for helping you remember the differences between the different collection classes in java.util
"Look inside magic, know something new"
Using the first letter again from each word
L-I
Lists use Indexes
M-K
Maps use Keys
S-N
Sets have No dulplicate elements
lance
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Thanks Barry. You have reminded me about assert. Since, it is not in JLS 2nd edition I did not include it. Here I am including it :

THIS is the FINAL day FOR "CATCH NATIVE Dogs" PACKAGE led by SHORT haired SUPER of municipality Mr. FLOAT Peterson, commonly known as STRICTFP since he is an INSTANCEOF the CLASS of CHARacters that are very strict about their jobs. He always strictly IMPLEMENTS the CONSTitutional rules and laws and ASSERTs, "I never be a DEFAULTer. IF in CASE I fail to DO my job everybody ELSE will TRY to insult me". WHILE driving aLONG the PUBLIC road with a NEW IMPORTed PRIVATE van, called BOOLEAN (since it runs like a bull ), INTernally PROTECTED by a DOUBLE-door VOID cage and equipped with modern INTERFACE of SYNCHRONIZED electronic SWITCHes and air-BREAK, he finds two dogs on the road. He EXTENDS his hands to THROW some pieces of meat. The dogs GOTO BYTE the pieces. Suddenly, he THROWS some VOLATILE and TRANSIENT liquid through the window and they look ABSTRACT, stand STATIC and FINALLY collapse. Strictfp, catches the dogs and RETURNs to CONTINUE his job.


[ January 02, 2003: Message edited by: Prosenjit Banerjee ]
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have already mentioned I have very very poor memory (usually find keys holding them in my hand ). As I failed to remember the associativity issue I set my mind like this:
Left-Right (left to right) is very usual not Right-Left, since the leader of the marching troop always says "Left-Right, Left-Right" and not "Right-Left, Right-Left".
So, the unusual case is Right to Left associativity. There are very few operators having associativity from Right to Left. So, I made the following line for these operators only.

PREsenting U A NEW TYPE of CONDITION


This can be explained like :

PREfixsenting Unary Assignment NEW TYPE cast of CONDITIONal


Now, read the excerpt from Khalid Mughal:

All unary operators (except for unary postfix operators), all assignment operators, and the ternary conditional operator (including object creation and cast) associate from right to left.


[ January 02, 2003: Message edited by: Prosenjit Banerjee ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
To remember that stupid colon:
Assert a conditional, double pointed, erroneous argument.
That is:
assert <condition> : <argument string for AssertionError>
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
And regarding the Conditional operator that confused me many times thinking whether it is ?: or :?, I set up my mind as below:
Always 1 comes first before 2. So, 1 dot must come before 2 dots, right?
Question mark contains 1 dot(?) whereas colon has 2( . That is why, ?: is correct.
exp1 ? exp2 : exp3
[ January 03, 2003: Message edited by: Prosenjit Banerjee ]
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
And, why Precendence is left? I have already discussed about memorizing operator's associativity, but didn't say about the operator's precendence. Let me now kill the problem of memorizing the operator's precendence.
But, I really don't think it will help others a lot. Only crazy people like me may like it. Assuming that there are some crazy guys like me I am sharing this
According to Khalid Mughal's book (page 42), the precedence chart is as follows. Here I have added an
extra column for what I will call each type of operators:

The precedence applies from top to bottom of this chart. Now look at the following carefully:


apProPriate NewType of MAd Surely REquires Bad Box Of pAndOra, Conditions Applied


Do you like it at all ?
[ January 07, 2003: Message edited by: Prosenjit Banerjee ]
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Cool idea!
Let me try, here's one on collections -
If you want them in order,
List is the need of the hour.
If no duplication is the bet,
Don't think beyond the Set.
And if it is about key-value pair,
Map is always gonna be there!
Now, is that creative enough?
- Manish
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

ice is cool, fire is hot
array index starts with always n0t

 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

while calling methods remember the difference
primitive passes value, object passes reference

 
Valentin Crettaz
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
while calling methods remember the difference
primitive passes value, object passes reference

But... the object reference is passed by value
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Valen, you are right. In that sense everything in the world is passed by value, it may be anything. But here the point is whether the reference is passed or not. Isn't there really any difference in passing a primitive and an object?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
See if this makes Sense
"Parsing Primitives is Valueable in Wrapper class.
Remember all are STrong NFE and Radix are not in FDs!!"
Means ParseXXX method returns Primitive type
ValueofXXX returns wrapper class.
STR stands for Static, String
All methods are staic, take string as a parameter, and throw NFE i.e. NumberFormatException.
Both methods of FDs means Float and Doubles classes do not take radix as a argument.
Anybody can change this to make more redable and memorizable
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I got one.
SYSTEM -
stands for
SLEEP & YIELD are STATIC THREAD's EVIL METHODS.
This is the method I use to distinguish between instance and static methods of thread class. I call them evil because they kept messing me up in the practise exams (until now)!!!
How about . . .
SNOW -
And you should use SYNCHRONIZED on NOTIFY OR WAIT methods of object.
 
Mike Gray
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
And another (which should be my New Year's resolution also) . . .
PLEASE ABSTAIN FROM EATING ICECREAM

The java keywords in class declarations are:
Publc
Abstract
Final
Extends
Implements
 
Mayuri Lakhani
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
One more
"Constructors are never SAFE"
S for Static
A for Abstract
F for Final
E - well couldnt find anything suitable for E :roll:
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Here's a memory aid for your contest:
To easily remember the correct order of Visibility Modifiers: "After PRIVATE, they're ALPHABETICAL"
i.e. After Private, you look at just the second letter, which forms an A-R-U order. Going up, they are PRIVATE, p*A*ckage/default, p*R*otected, and p*U*blic
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Heres my contribution...
------------------------------------------
If you are static
you cannot make your children non-static
If you are non static
your children cannot be static
------------------------------------------
Meaning static method cannot be over-ridden by non-static method and vice versa...
--------------------------------------------
Catch Specialized thiefs first
They have more expertise
--------------------------------------------
Meaning in catch blocks sub class exceptions should be caught first otherwise compiler complains...
--------------------------------------------
If you have access level 3
Why to give your children access level 1
--------------------------------------------
Meaning you cannot overide to more restrictive access modifiers...

Thanks.
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Originally posted by Mayuri Lakhani:
One more
"Constructors are never SAFE"
S for Static
A for Abstract
F for Final
E - well couldnt find anything suitable for E :roll:


How about -->
E -- have no return typE ??
its a stretch -- but an important thing to note --especially for the SCJP exam -- that's a favorite trick... err "clever"... question.
 
sun par
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Heres one more
---------------------------------------------
If I dont have a default start
And my children try to start
Without calling me
They are in a fix
---------------------------------------------
Meaning if there is no default constructor in the parent and if in the child constructor there is no call to some other defined constructor, there is an compiler error.
Thanks.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

"Constructors are never SAFE"
S for Static
A for Abstract
F for Final
E - well couldnt find anything suitable for E


E: They ain't nivver Enherited?
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Howdy Hi there friends and neighbors !
Well these entries are all amazing! Just a little update, and a reminder.
Officially, the contest ends at midnight Jan 7, in Colorado, USA. (one hour later than the west coast). However, if you like to live dangerously, we probably will collect any entry that arrives before we sign on Wednesday morning!
And... because we have had so many wonderful entries, we have decided to add a third prize! There are now three ( for(int x=0; x<3; x++) ) count 'em books up for grabs!!!
So, pull out all the stops, and rush in those last minute entries ! Good luck and have fun!
-Bert (and the cowgirl)
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
How about this one?
- Manish
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

~X == -X - 1

 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator


BOOLEAN == BULL is alone
put the BuTtonnEd SHiRT and the CHARt INTo LONG FLAT DrawEr


BOOLEAN is not convertable to any other primitive type. ByTE is convertable to SHoRT and each of them can go to INT, also CHAR can be converted to INT but not to any of ByTE and SHoRT or vice versa. INT can go to LONG, LONG to FLoAT and FLoAT to DoublE.
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator


Jaa, Vaa, black sheep,
Have you any LOOL?
Yes sir, yes sir,
THREE bags full
One is the true and
One is the false
Last is the null
Don't miss these all


JaVa has THREE LOOLs (reserved LiteraLs) -- true, false and null.
[ January 07, 2003: Message edited by: Prosenjit Banerjee ]
 
Prosenjit Banerjee
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator


Keep abstracts away from finals
Compare objects with equals

 
Enjoy the full beauty of the english language. Embedded in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic