Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package day2_loops;
- import java.util.Scanner;
- /**
- *
- * @author sao_7
- */
- public class Day2_loops {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- stars();
- }
- public static void loops(){
- //for, while,do..while, for-each
- for(int i = 0; i<5; i++){
- System.out.println(i);
- }
- }
- public static void stars(){
- //*
- //**
- //***
- //****
- String output = "";
- for(int i = 0; i<4; i++){
- output = output + "*";
- System.out.println(output);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement