How are commas used in the initialization and iteration
parts of a for statement?
Answers were Sorted based on User's Feedback
Answer / ravikiran(aptech mumbai)
for(int a=1,b=1;a<15&&b<20;i++,j++)
| Is This Answer Correct ? | 3 Yes | 0 No |
Commas are used to separate the initialization and
iteration parts in the for statement.
| Is This Answer Correct ? | 2 Yes | 1 No |
What is a method in programming?
Given: 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result? 1 Compilation fails because of an error in line 25. 2 The code runs with no output. 3 An exception is thrown at runtime. 4 Compilation fails because of an error in line 20.
Is java a compiler?
What is the use of ?this??
What is the difference between iterator and enumeration ?
Can a class be private or protected in java?
Is an empty arraylist null?
What is difference between overloading and overriding?
What will happens if you opened Internet Explorer 4 times?
What is the generic class?
What is exception and error? and what is the difference between them?
What is a finally block?