Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 1.2 KB

File metadata and controls

20 lines (13 loc) · 1.2 KB

Command-Line Maximum Value Finder

Course: Object-Oriented Programming in JAVA Lab (BCA39109) | Semester: BCA 3rd Sem

This project is a Java console application that processes command-line arguments to find the largest integer among a set of user-provided values. It robustly handles invalid inputs and empty arguments using Java's built-in exception handling.

🧠 Core Concepts Demonstrated

  • Command-Line Arguments: Utilizing the String[] args parameter in the main method to pass data into the program at runtime.
  • Exception Handling (try-catch): Catching NumberFormatException to prevent the program from crashing if a user inputs text or symbols instead of valid numbers.
  • Wrapper Classes: Using Integer.parseInt() to convert string arguments into primitive int values.
  • State Tracking: Utilizing boolean flags to verify if at least one valid integer was successfully parsed before attempting to output a final mathematical result.

🚀 How to Compile and Run

To run this program, ensure you have the Java Development Kit (JDK) installed on your machine.

  1. Open your terminal or command prompt.
  2. Navigate to the directory containing the file.
  3. Compile the Java code: