Guest User

Untitled

a guest
Apr 18th, 2019
82
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // java array find a max and min num
  2.  
  3. String[] num = {"Uzzal","Suzal","Rahim","Zahid"};
  4. System.out.println(num[2]);
  5.  
  6.  
  7. //for each loop String crate
  8. for (String s: num){
  9.  
  10. System.out.println(s);
  11. }
  12.  
  13.  
  14. //for each loop int crate:-
  15. int [] allnum = {10,20,30,40,50,60,70,80,90,100};
  16. int sum = 0;
  17.  
  18. for (int res:allnum){
  19.  
  20. sum = sum+res;
  21.  
  22. System.out.println("For Int Aray: "+res);
  23. System.out.println("For Int Aray: "+sum);
  24. }
RAW Paste Data