Write a java program that displays a box, an oval, an arrow and a diamond using asterisk
Answers
Answer:
This is the answer. Hope it helps
A java program that displays a box, an oval, an arrow and a diamond using an asterisk is as follows:
The program draws four shapes as follows,
public class DisplayShapes{
public static void main(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("********* *** * * ");
} // end main
} //end class
Here,
- Public is a Java keyword which declares a member's access as public.
- Class is a user-defined blueprint or prototype from which objects are created.
- System.out.println prints the argument passed to it.