Home » Software Development

Java: Common mistakes for new programmers #1

New Java programmers often make similar mistakes when they start out coding – I did it myself when I started out and I have seen many others do the same. One of the most common mistakes is to use a different name (or even a different case) for the Java Class itself and the filename. Typically, Java expects the Class Name to match the file name ending in .java.

So, if the Class name is MyApp then the file name should usually be MyApp.java and it is also important to maintain the correct upper and lower case letters, for example – the following piece of code should be stored in MyApp.java

 public class MyApp
{
public MyApp()
{
}
}

Related Posts with Thumbnails

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.