DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Top Ten Errors Java Programmers Make

Top Ten Errors Java Programmers Make

Mohamed Sanaulla user avatar by
Mohamed Sanaulla
CORE ·
Jun. 16, 08 · Java Zone · Interview
Like (0)
Save
Tweet
19.38K Views

Join the DZone community and get the full member experience.

Join For Free

i read an article (linked below) on “ top ten errors java programmers make “. the author has mentioned the errors which even the most experienced programmers often commit or the new to java programmers may commit in the future. not only has he listed the errors but also given the possible solution for the same. i found the article really informative.

one can read the article here .

i would like to add some more:

  • a .java source file can contain more than one class but it can contain atmost one top level class (or interface) definition that is public and the name of the source file must be same as that of the public class (or interface).
  • static methods cannot be overridden but can be hidden if they are not final (read about overriding vs hiding here ).
  • the objects created in the string pool are not subjected to gc until the class is unloaded by the jvm.
  • only methods or code blocks can be marked “synchronized”.
  • local classes cannot access non-final variables.
  • -0.0 == 0.0 is true.
  • collection (singular) is an interface, but collections (plural) is a helper class.
  • continue must be in a loop (e.g., for, do, while). it cannot appear in case constructs.
  • instance initializers are executed only if an object is constructed.
do you have some key points in java to share? add it as comments to the post :)
Programmer (hardware) Java (programming language)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Test Plan and Test Strategy: Best Practices That Will Make Your Product Development a Success
  • Creating Event-Based Architecture on Top of Existing API Ecosystem
  • What Is Code Refactoring and Why Should You Do It?
  • Augmented Analytics: The Future of Business Intelligence

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo