GIDForums  

Go Back   GIDForums > Computer Programming Forums > Java Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 23-Aug-2009, 22:33
jocatix jocatix is offline
New Member
 
Join Date: Aug 2009
Posts: 3
jocatix is on a distinguished road

How to add Quotations?


haha i cant figure out, how do i add ""? I keep getting errors, i need to put "Hello World" how do i put the ""?
  #2  
Old 24-Aug-2009, 06:44
Mexican Bob's Avatar
Mexican Bob Mexican Bob is offline
Member
 
Join Date: Mar 2008
Location: Chicxulub, Yucatán
Posts: 226
Mexican Bob is a jewel in the roughMexican Bob is a jewel in the roughMexican Bob is a jewel in the rough

Re: How to add Quotations?


Quote:
Originally Posted by jocatix
haha i cant figure out, how do i add ""? I keep getting errors, i need to put "Hello World" how do i put the ""?

Is there any possible way that you can STEP BACK from your own posting for just a few seconds and read it outside of the context of whatever is going on inside your head? We're not mind readers. Do we have any idea whatsoever what you're asking?

I can't figure out how to add ""?

..add to WHAT? Inside a PATH statement? Inside your code?


IF you mean inside of code, you "escape" them using a BACKSLASH character as follows:


JAVA Code:
   System.out.println("\"Hello World\"");


Please try to understand that we have to read whatever it is that you've written and figure out what you want from that and our own personal sets of experiences. Don't make us play detectives. The more you help us, the more we can help you. A clear and complete presentation of the problem INCLUDING any code or snippet that illustrates what DOES NOT work for you, will be helpful.

As with anything related to programming, there are typically many different ways to accomplish the same objective. There are usually pros and cons to each particular way, so some ways don't make any "good sense," even though they exist. Here's an example:

JAVA Code:
public final class Hello {
  public static void main(String[] args) {
    System.out.println("\"Hello World\"");
    System.out.println('"' + "Hello World" + '"');
    System.out.println((char)0x22 + "Hello World" + (char)0x22);
  }
}


Output:

Code:
bash-3.2$ java Hello "Hello World" "Hello World" "Hello World"


MxB
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 14:29.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.