Beginners Programs :

Java Program : Calculate Batting Average Example | Hub

Java Program to calculate the batting average. The following program is written in five different ways by using standard values, user-defined method, scanner class, through creating a separate class. Do check it out.

Learn More:

By Using Standard Values


  • There you go, by using the basic standard input values we wrote this program


2. By Using Scanner Class

  • By using scanner class: There you method: 2 just by using scanner class. Do check it out.

3. Using Command Line Arguments 

By using command line arguments: If you have no idea about what are command line arguments do check out our guide: Here.


4.By Using User Define Method

There you go another program using a user-defined method.


5. Separate Class

Java program for calculating batting average through creating a separate class(AvgCalculation ) and taking inputs through scanner class.

Learn More:

List of complete Beginner Programs

222 Java Interview Questions For Beginners

Learn More About Data Types And Variables