Question: Q1. Read a String (class method, no parameters) Using the keyword static, define this method. Create an instance of the Scanner class. Prompt the user
Q1. Read a String (class method, no parameters) Using the keyword static, define this method. Create an instance of the Scanner class. Prompt the user to enter a String Using the Scanner instance, read the String Return the String the user entered Call the method from the main method Q2. Read a String (class method, Scanner passed as a parameter) Using the keyword static, define this method. Prompt the user to enter a String Using the Scanner instance passed to the method, read the String Return the String the user entered Create an instance of the Scanner class in the main method Call the method from the main method passing the Scanner instance as a parameter Q3. Is Palindrome Create a method, is Palindrome, which returns true if the String passed to it is a palindrome and false if it is not Q4. Create an integer array named dice1 with a size of 10. Populate each array location with a roll of a six-sided die (hint: an int value of 1 through 6). Print the array out using an enhanced for loop. Sample output: dice1 - 1 1623 51545
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
