DZone
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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Java
  4. Top Ten Errors Java Programmers Make

Top Ten Errors Java Programmers Make

Mohamed Sanaulla user avatar by
Mohamed Sanaulla
CORE ·
Jun. 16, 08 · Interview
Like (0)
Save
Tweet
Share
19.70K 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

  • Steel Threads Are a Technique That Will Make You a Better Engineer
  • Tracking Software Architecture Decisions
  • Monolithic First
  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • 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: