Java School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a Java Expert!

Join 307,165 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,542 people online right now. Registration is fast and FREE... Join Now!




basic java coding

 

basic java coding, continuing a line

ellevador

19 Sep, 2009 - 06:58 PM
Post #1

D.I.C Head
**

Joined: 1 Mar, 2009
Posts: 68


My Contributions
I am writing a print statement that is going on and on and I want to break it up in two lines so its easier to read, rather than scrolling over..any help on how I do that?


Thanks
Just learning smile.gif


ugh wrong programming language area sorry thats what happens when i take both java and vb at the same time

This post has been edited by ellevador: 19 Sep, 2009 - 07:00 PM

User is offlineProfile CardPM
+Quote Post


ellevador

RE: Basic Java Coding

19 Sep, 2009 - 07:01 PM
Post #2

D.I.C Head
**

Joined: 1 Mar, 2009
Posts: 68


My Contributions
I am writing a print statement that is going on and on and I want to break it up in two lines so its easier to read, rather than scrolling over..any help on how I do that?


Thanks
Just learning smile.gif

User is offlineProfile CardPM
+Quote Post

AbuJaFaR

RE: Basic Java Coding

19 Sep, 2009 - 07:03 PM
Post #3

D.I.C Regular
***

Joined: 13 Dec, 2007
Posts: 292



Thanked: 8 times
My Contributions
You can use the System.out.println("String here");
If that is what you want. It prints something in a new line.
Or you can use the '\n' character inside your print statements.

This post has been edited by AbuJaFaR: 19 Sep, 2009 - 07:04 PM
User is offlineProfile CardPM
+Quote Post

ellevador

RE: Basic Java Coding

19 Sep, 2009 - 07:07 PM
Post #4

D.I.C Head
**

Joined: 1 Mar, 2009
Posts: 68


My Contributions
I am calling strings, ints variables all in one line of textpad of system.out.print("blah") and I know there is a way in visual basics to type a code and continue that same code statement on next line and it reads it the same like (space_) in VB.

Its hard to explain thats why I couldnt find anything in search.web

if any of that makes sense? like its just for me rather than the user

This post has been edited by ellevador: 19 Sep, 2009 - 07:08 PM
User is offlineProfile CardPM
+Quote Post

Christopher Elison

RE: Basic Java Coding

19 Sep, 2009 - 07:09 PM
Post #5

D.I.C Head
**

Joined: 29 Dec, 2008
Posts: 226



Thanked: 37 times
My Contributions
You can break up long lines of text and concatenate them with '+' like so:
java

System.out.println("This is a really long line of text here " +
"and it continues here, and " +
"even continues down here"
);


This post has been edited by Christopher Elison: 19 Sep, 2009 - 07:13 PM
User is offlineProfile CardPM
+Quote Post

AbuJaFaR

RE: Basic Java Coding

19 Sep, 2009 - 07:10 PM
Post #6

D.I.C Regular
***

Joined: 13 Dec, 2007
Posts: 292



Thanked: 8 times
My Contributions
QUOTE(ellevador @ 19 Sep, 2009 - 07:07 PM) *

I am calling strings, ints variables all in one line of textpad of system.out.print("blah") and I know there is a way in visual basics to type a code and continue that same code statement on next line and it reads it the same like (space_) in VB.

Its hard to explain thats why I couldnt find anything in search.web

if any of that makes sense? like its just for me rather than the user


Did you tried the \n character?
Copy-paste here the statement and the output you want.
User is offlineProfile CardPM
+Quote Post

ellevador

RE: Basic Java Coding

19 Sep, 2009 - 07:14 PM
Post #7

D.I.C Head
**

Joined: 1 Mar, 2009
Posts: 68


My Contributions
oh hotness!
Awesome exactly what I needed for what I meant

Thanks






quote name='Christopher Elison' date='19 Sep, 2009 - 07:09 PM' post='772927']
You can break up long lines of text and concatenate them with '+' like so:
java

System.out.println("This is a really long line of text here " +
"and it continues here, and " +
"even continues down here"
);

[/quote]

User is offlineProfile CardPM
+Quote Post

AbuJaFaR

RE: Basic Java Coding

19 Sep, 2009 - 07:16 PM
Post #8

D.I.C Regular
***

Joined: 13 Dec, 2007
Posts: 292



Thanked: 8 times
My Contributions
Oh I meant you mean for the output of the program.Not the source code.lol.Sleepy me.
User is offlineProfile CardPM
+Quote Post

ellevador

RE: Basic Java Coding

19 Sep, 2009 - 07:17 PM
Post #9

D.I.C Head
**

Joined: 1 Mar, 2009
Posts: 68


My Contributions
Yeah sleepy me, hard to explain crap on the net, text, whatever
thanks anyways

QUOTE(AbuJaFaR @ 19 Sep, 2009 - 07:16 PM) *

Oh I meant you mean for the output of the program.Not the source code.lol.Sleepy me.


User is offlineProfile CardPM
+Quote Post

PsychoCoder

RE: Basic Java Coding

19 Sep, 2009 - 08:41 PM
Post #10

I Code, Therefore I am
Group Icon

Joined: 26 Jul, 2007
Posts: 14,939



Thanked: 519 times
Dream Kudos: 11575
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Moved to Java smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 06:09PM

Live Java Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month