Java Lab Exercises 1
Java Lab Exercises 1
• Write a Java program that takes an arbitrary number of command-line arguments and
prints them in reverse order.
• If no arguments are provided, the program should print a message indicating that no
arguments were passed.
Learning Objective:
Sample Execution:
Output:
• Create a Java program that accepts a series of integers as command-line arguments and
calculates their average.
• The program should handle any incorrect input (non-integer values) gracefully by
displaying an appropriate error message.
• If no integers are provided, it should inform the user.
Learning Objective:
• Develop a Java program that takes a single string as a command-line argument and
checks whether the string is a palindrome (a string that reads the same backward as
forward).
• The program should print a message indicating whether the input string is a palindrome
or not.
• If no argument or more than one argument is provided, the program should display a
usage message.
Learning Objective:
Sample Execution: