This link has been bookmarked by 85 people . It was first bookmarked on 23 Mar 2006, by Alex Fanjul.
-
04 Mar 15
-
01 Mar 14
-
28 Dec 12
-
07 Dec 11
-
03 Apr 11
-
14 Feb 11
-
02 Feb 11
-
16 Jan 11
-
05 Nov 10
-
25 Oct 10
-
24 Oct 10
-
03 Sep 10
-
static methods (such as main)
-
signature
-
marked static - meaning that we don't need to create an instance of the class
-
public String my_member_variable
-
my_member_variable
-
If you want to access
-
member variables from a non-static method
-
you must create an instance of the object
-
NonStaticDemo demo = new NonStaticDemo();
-
demo.my_member_variable );
-
-
19 May 10
-
31 Mar 10
-
02 Feb 10
-
demo = new NonStaticDemo();
-
demo.
-
Comparison assignment ( = rather than == )
-
objects
-
to see if they point to the same object.
-
we are actually comparing two object references
-
.equals method, which is a method inherited by all classes from java.lang.Object.
-
if ( (abc + def).equals("abcdef") )
-
When you pass a primitive data type
-
passing by value. That means that a copy of the data type is duplicated, and passed to the function. If the function chooses to modify that value, it will be modifying the copy only.
-
When you pass a Java object, such as an array, a vector, or a string, to a function then you are passing by reference. Yes - a String is actually an object
-
Any changes you make to the object's member variables will be permanent - which can be either good or bad, depending on whether this was what you intended.
-
Java is zero-indexed
-
Just like the ArrayOutOfBoundsException, there is a string equivalent. Accessing beyond the bounds of a String will cause a StringIndexOutOfBoundsException to be thrown, as demonstrated by this example.
-
all methods and member variables in the Java API begin with lowercase letters
-
all methods and member variables use capitalization where a new word begins e.g - getDoubleValue()
-
-
23 Dec 09
-
Accessing non-static member variables from static methods (such as main)
-
Mistyping the name of a method when overriding
-
Comparing two objects ( == instead of .equals)
-
When you pass a primitive data type, such as a char, int, float, or double, to a function then you are passing by value
-
When you pass a Java object, such as an array, a vector, or a string, to a function then you are passing by reference
-
I know it's very tempting to write blank exception handlers, and to just ignore errors. But if you run into problems, and haven't written any error messages, it becomes almost impossible to find out the cause of the error.
-
Forgetting that Java is zero-indexed
-
Preventing concurrent access to shared variables by threads
-
Capitalization errors
-
1. Null pointers!
-
-
24 Aug 09
-
28 Jul 09
-
18 Jun 09
-
13 May 09
-
program regularly in Java, and know it like the back of your hand, or whether you're new to the language or a casual programmer, you'll make mistakes. It's natural, it's human, and guess what? You'll more than likely make the same mistakes that others do, over and over again. Here's my top ten list of errors that we all seem to make at one time or another, how to spot them, and how to fix them.
-
-
07 May 09
Jarjee jarVery helpful because I couldn't work out why I couldn't reference non-static variables from static main.
-
25 Mar 09
-
17 Dec 08
-
09 Dec 08
-
04 Aug 08
-
24 Jun 08
-
18 Jun 08
-
17 Jun 08
-
15 May 08
-
31 Mar 08
-
07 Dec 07
-
03 Nov 07
-
08 Jun 07
-
27 Mar 07
-
25 Feb 07
Ivan Rivera(How to spot them. How to fix/prevent them.)
**** article Development howto java programming Reference tips
-
riveraivan(How to spot them. How to fix/prevent them.)
**** article Development howto java programming Reference tips
-
16 Nov 06
-
26 Oct 06
-
14 Sep 06
Art istHere's my top ten list of errors that we all seem to make at one time or another, how to spot them, and how to fix them.
-
10 Sep 06
-
06 Aug 06
-
26 Jul 06
-
25 Mar 06
-
24 Mar 06
-
23 Mar 06
-
22 Mar 06
-
21 Mar 06
Page Comments
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.