Question: package yourturn 1 ; public class Start { public static void main ( String [ ] args ) { / * Instructions - Part A

package yourturn1;
public class Start {
public static void main(String[] args)
{
/*Instructions -Part A .
In the Utility class, write a method called getStringInput which will accept a String and return a String. Use the passed in String as the prompt and create a JOPtionPane.showMethodDialog, passing it the prompt String. Return the string that the user typed in.
Next write a method called getIntInput that works exactly the same way but will return an int instead of a String. Remember the Integer.parseInt will convert a String to an int.
In this main method, instantiate a Utility object and ask the user to type in their name and their favouring number.
Finally, print out "Hello, , your favourie number is "
*/
/*Instructions -Part B .
Let's change our Utility Class so that we don't have to instantiate a Utility object in order to call our two methods. Change the code in the main method to be able to use the methods directly without the need to instantiate an object
*/
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!