Java Learning Made Easy by Dheeraj Mehrotra - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Programming Instructions In JAVA

01183.jpg01184.jpg01185.jpg01186.jpg01187.jpg01188.jpg01189.jpg01190.jpg

Output Statements:

01191.jpg01192.jpg

The println( ) method or the function is used to display information on

01193.jpg

the screen. It also provides a line feed i.e. transfers the cont rol to the next line of the output.

01194.jpg01195.jpg01196.jpg// Example program to utilize println( ) method

 

01197.jpg01198.jpg01199.jpg

class output

01200.jpg01201.jpg

{ public void display()

01202.jpg

{int a=10;

01203.jpg

int b=20;

01204.jpg

int c=30;

01205.jpg01206.jpg

int d=40;

01207.jpg

System.out.println("The usage of println( ) method");

01208.jpg

System.out.println("The value of a is "+a);

01209.jpg01210.jpg

System.out.println("The value of b is "+b);

01211.jpg

System.out.println("The value of c is "+c);

01212.jpgSystem.out.println("The value of d is "+d);
01213.jpg01214.jpg}}
01215.jpg01216.jpg01217.jpgattention@computerscienceexpertise.com
01218.jpg01219.jpg01220.jpg01221.jpg
01222.jpg01223.jpg01224.jpg01225.jpg01226.jpg01227.jpg01228.jpg01229.jpg01230.jpg01231.jpg01232.jpg01233.jpg01234.jpg01235.jpg01236.jpg01237.jpg01238.jpg01239.jpg