TopBottom

Followers

Followers



Click on more
SUBSCRIBE



VIDEO

Announcement: wanna exchange links? contact me at ravikrak@yahoo.com

Assignments and Initialization in Java

Posted by Ravi Kumar at Wednesday, March 4, 2009
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

After declaring a variable, we initialize a value by using assignment statement. We assign to a previously declared variable using the variable name on the left, an equal sign (=), and then some Java expression that has an appropriate value on the right.

Int Days; // this is a declaration
Days = 30; // this is an assignment

Another feature of Java is we can do both declare and initialize a variable on the same line.
Ex: Int Days = 30; // this is an initialization

In Java you can put declarations anywhere in your code.

Share |

Labels:

0 comments:

Post a Comment