http://www.java-tips.org/java-se-tips/ja va.lang/the-enhanced-for-loop.html
[Sample Code]
String[] array = {"Ahmed","Mohamed","Salama"};
for(String i:array){
System.out.println(i);
}
output :: Ahmed Mohamed Salama
2] Using Generics ::
Use it if you needed to restrict your collection to a specific type.
[Sample Code]
Stack s = new Stack();
s.push(10);
int temp = s.pop();
More tips to follow isAllah :) ...
No comments:
Post a Comment