explain multiple initializers and incrementers


Explain Multiple Initializers and Incrementers ?

Sometimes it's essential to initialize several variables before starting a for loop. Similarly you may need to increment more than one variable. Java lets you do this through placing a comma among the different initializers and incrementers such as this:
for (int i = 1, j = 100; i < 100; i = i+1, j = j-1) {
System.out.println(i + j);
}
You can't, thus, involved multiple test conditions, at least not along with commas. The subsequent line is illegal and will produce a compiler error.
for (int i = 1, j = 100; i <= 100, j > 0; i = i-1, j = j-1) {
To involve multiple tests you required to use the boolean logic operators && and || that will be discussed later.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: explain multiple initializers and incrementers
Reference No:- TGS0284380

Expected delivery within 24 Hours