Explain multiple initializers and incrementers, JAVA Programming

Assignment Help:

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.


Related Discussions:- Explain multiple initializers and incrementers

Package, how to write bank system

how to write bank system

What are separators in java, What are separators in java? Separators he...

What are separators in java? Separators help elaborates the structure of a program. The separators used within HelloWorld are parentheses, ( ) , braces, { } , the period, .

Need to modify joomla component, Project Description: I want to modify J...

Project Description: I want to modify Joomla component. Now there is Akeeba subscription component on this site. It works and the whole thing is fine, but there is no "teaser

Method overriding, how to write method overriding and example programe

how to write method overriding and example programe

Write a xhtml document with java script, Write an XHTML document that uses ...

Write an XHTML document that uses JavaScript code to do the following.  The user is first prompted for a word and then for a possible prefix for that word.  If the prefix is not an

What can an applet do, What Can an Applet Do? An applet can: • Draw ...

What Can an Applet Do? An applet can: • Draw pictures on a web page • Create a new window and draw in it. • Play sounds. • Receive input from the user by the keyboard or

What is aop(aspect oriented programming)?, Separating your business logic w...

Separating your business logic with other functionality such as services, Loggers etc, making classess more cohesive.

A new dynamic website, A NEW Dynamic Website I have the subsequent requi...

A NEW Dynamic Website I have the subsequent requirement which needs to be designed in 30 days (Max). 1) Construct a website which is a dynamic, means allow me to change conte

What is spring configuration file, Spring configuration file is an XML file...

Spring configuration file is an XML file. This file having the classes information and defines how these classes are configured and introduced to each other.

What does wan stand for, What does WAN stand for? Wide Area Network - A...

What does WAN stand for? Wide Area Network - A network in that computers are separated through great distances classically across cities or even continents.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd