Advertisement
Varasku

Pętle z argumentami 3 sem

Oct 17th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public class SimpleApplicationMain
  2. {
  3. public static void main(String[]args)
  4. {
  5. System.out.print("Main method\n");
  6. System.out.println("Pokaz parametry z tablicy String args[]");
  7. int parameterCount = args.length;
  8. //Typowe użycie pętli
  9. for (int i=0;i<parameterCount;i++)
  10. {
  11. System.out.println(args[i]);
  12. }
  13. //petla for:each
  14. for(String value:args)
  15. {
  16. System.out.println(value);
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement