Elite Coders Society
Hello Guest!
Join us here in this forum!
Please Log in or Register to access more feature in this site.
Start Learning!

† Copyright ©️ 2011 - EliteCoders.forums.ag †
Elite Coders Society
Hello Guest!
Join us here in this forum!
Please Log in or Register to access more feature in this site.
Start Learning!

† Copyright ©️ 2011 - EliteCoders.forums.ag †


Start sharing and learning new skills about programming and design by building connections with other professional and students.
 
HomeForum Displaying Syntax System.out.print 2a512xyPortalLatest imagesGallery Displaying Syntax System.out.print Dw6hztSearch Displaying Syntax System.out.print 2ns506p Displaying Syntax System.out.print 2dt2b75RegisterLog in
Elite Coders Partner Links

EliteCoders™️ News!
Hello Guest!, Welcome in our forum. Be active!

Share | 
 

  Displaying Syntax System.out.print

View previous topic View next topic Go down 
AuthorMessage
Admin[dElmARk]
Admin[dElmARk]
Forum Owner
Forum Owner

Posts : 78
EC-Points : 6304
Thanked : 21
Join date : 15/10/2011
Age : 29
Location : Philippines

Hacker's Info
Hacking Exp:
 Displaying Syntax System.out.print Left_bar_bleue0/0 Displaying Syntax System.out.print Empty_bar_bleue  (0/0)
Hacker Type: White Hat
Hacking Title:

 Displaying Syntax System.out.print Empty
PostSubject: Displaying Syntax System.out.print    Displaying Syntax System.out.print EmptySun Oct 16, 2011 4:09 am

Statements Sample

Displaying Syntax


Code:
System.out.print(“[Message]”);
System.out.print(“[Message]”);

Output:
[Message][Message]


Code:
System.out.println(“[Message]”);
System.out.println(“[Message]”);

Output:
[Message]
[Message]



The difference of print and println
print - displays the content on the same line
println - displays the content on the next line


Last edited by Admin[dElmARk] on Fri Nov 18, 2011 5:15 pm; edited 1 time in total
Back to top Go down
Admin[dElmARk]
Admin[dElmARk]
Forum Owner
Forum Owner

Posts : 78
EC-Points : 6304
Thanked : 21
Join date : 15/10/2011
Age : 29
Location : Philippines

Hacker's Info
Hacking Exp:
 Displaying Syntax System.out.print Left_bar_bleue0/0 Displaying Syntax System.out.print Empty_bar_bleue  (0/0)
Hacker Type: White Hat
Hacking Title:

 Displaying Syntax System.out.print Empty
PostSubject: Re: Displaying Syntax System.out.print    Displaying Syntax System.out.print EmptySun Oct 16, 2011 4:27 am

Create a sample program:

Code:

class Pname{
public static void main(String [] args){
System.out.println("[Message]");
System.out.println("[Message]");
}
}


_____________

Save as Pname.java
Compiling and Running
1. Start then Run.
2. Type cmd (Press enter).
3. Go to the drive of your folder.
Ex: c: (Press enter)
4. Compile your program.
Ex: c Pname.java (Press enter).
5. Run the program.
Ex. r Pname (Press enter).


Note:
The 4 and 5 are your batch files
Link: [You must be registered and logged in to see this link.]
Back to top Go down
Admin[dElmARk]
Admin[dElmARk]
Forum Owner
Forum Owner

Posts : 78
EC-Points : 6304
Thanked : 21
Join date : 15/10/2011
Age : 29
Location : Philippines

Hacker's Info
Hacking Exp:
 Displaying Syntax System.out.print Left_bar_bleue0/0 Displaying Syntax System.out.print Empty_bar_bleue  (0/0)
Hacker Type: White Hat
Hacking Title:

 Displaying Syntax System.out.print Empty
PostSubject: Re: Displaying Syntax System.out.print    Displaying Syntax System.out.print EmptyFri Nov 18, 2011 5:23 pm

Displaying Variable

Code:

VarType varName = content;
System.out.print(varname);


Sample:
String name = "Your name";
System.out.print(name);

Output:
Your name

________________
Displaying morethan one variable/message.

Sample:
Sting name = "Juan";
int age = 16;
System.out.print("Name: " + name + "Age: " + age);

Output:
Name: Juan Age: 16


Note: You must use the plus sign(+) to add the variable and use two double quote ("") in displaying a message.
Back to top Go down

Sponsored content



 Displaying Syntax System.out.print Empty
PostSubject: Re: Displaying Syntax System.out.print    Displaying Syntax System.out.print Empty

Back to top Go down
 

Displaying Syntax System.out.print

View previous topic View next topic Back to top 

 Similar topics

-
» BufferedReader Syntax
» Scanner Syntax
» Syntax for a Java Program
» Buffered Reader Syntax
» Java Basic Syntax (E-Book)
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Elite Coders Society :: Software Development :: Java Programming :: Java Programming-

Protected by Copyscape Duplicate Content Finder
Powered By EliteCoders™

Elite Coders Partner Links
GreyPhantomYour Link HereYour Link HereYour Link Here
Yahoo!GoogleFacebookForumotion