InfoQ Homepage   	  		  			  			                  News                 		  		Breaking Down Barriers: Introducing JDK 21’s Approach to Beginner-Fr

Breaking Down Barriers: Introducing JDK 21’s Approach to Beginner-Friendly Java Programming

submited by
Style Pass
2023-05-24 18:00:09

InfoQ Homepage News Breaking Down Barriers: Introducing JDK 21’s Approach to Beginner-Friendly Java Programming

JEP 445, Unnamed Classes and Instance Main Methods (Preview), has been promoted from its Proposed to Target to Targeted status. This feature JEP, formerly entitled Implicit Classes and Enhanced Main Methods (Preview), proposes to "evolve the Java language so that students can write their first programs without needing to understand language features designed for large programs." This is a preview language feature.

This JDK Enhancement Proposal (JEP) aims to make Java more approachable for beginners and is led by Brian Goetz, a renowned engineer at Oracle Corporation and the Java language architect. Goetz has detailed the context of this proposal on the OpenJDK website, titled Paving the on-ramp, acknowledging that while Java is a widely taught language and appreciated for its simplicity, it does present some initial challenges to newcomers. Specifically, beginners often find the necessity of declaring a class and understanding the "public static void main" method to be somewhat challenging concepts to grasp.

The proposal puts forth three significant changes to address these concerns: the introduction of a more forgiving launch protocol; the inclusion of unnamed classes; and the establishment of predefined static imports for vital methods and fields. These changes are expected to simplify the learning process and make Java a more welcoming language for those embarking on their programming journey​ in jshell or Notepad or a full-fledged IDE.

Leave a Comment