Answers for "how to make pyramid in java"

1

how to create a circle in java

public class scratch {
    public static void main(String[] args) {
        JFrame window = new JFrame();
        window.setTitle("Christmas Tree");
        window.setSize(700, 600);
        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        window.setVisible(true);
        DrawingComponent DC = new DrawingComponent();
        window.add(DC);
    }
}
class DrawingComponent extends JComponent{
      public void paint(Graphics graph0){
        Graphics2D graph = (Graphics2D) graph0;
        Ellipse2D.Double circle = new Ellipse.Double(5, 5, 25, 25);
        graph.fill(circle);
      }
}
Posted by: Guest on January-10-2020
2

how to make fizzbuzz in python

for x in range(100):
  output = ""
  if x % 3 == 0:
    output += "Fizz"
  if x % 5 == 0:
    output += "Buzz"
  print(output)
Posted by: Guest on January-05-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language