Question: package code; public class AssignmentOne { public static void main(String[]args) { System. out .println(* * * * * *); System. out .println(*); System. out .println(*);
packagecode;
publicclassAssignmentOne {
publicstaticvoidmain(String[]args) {
System.out.println("* * * * * *");
System.out.println("*");
System.out.println("*");
System.out.println("* * * * * *");
System.out.println(" *");
System.out.println(" *");
System.out.println("* * * * * *");
System.out.println("*");
System.out.println("*");
System.out.println("* * * * * *");
System.out.println(" *");
System.out.println(" *");
System.out.println("* * * * * *");
System.out.println("*");
System.out.println("*");
}
}
Use Java methods to eliminate redundancy, with a goal of making the program as small as possible. In this assignment your main() method should only contain calls to other methods, though in general that is not a good strategy. My solution uses 3 methods other than main.
My question is how do I eliminate redundacy to my solution while making it work?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
