Computer Science, asked by hithitinmuna420, 6 days ago

Write a java program that displays a box, an oval, an arrow and a diamond using asterisk​

Answers

Answered by Phantos
0

Answer:

This is the answer. Hope it helps

Attachments:
Answered by Hansika4871
1

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.
Similar questions