aspose file tools*
The moose likes Beginning Java and the fly likes String without double quotes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String without double quotes" Watch "String without double quotes" New topic
Author

String without double quotes

Hd Desai
Ranch Hand

Joined: Aug 04, 2003
Posts: 65
Hi,

I am new to Java,

I want to insert a string in database but it should not have double quotes.

e.g i want to insert string TJ2003W.

But when we declare this as string it is surronded by double quotes.

Pls help reagrding this.
Mark Mescher
Ranch Hand

Joined: Oct 25, 2004
Posts: 34
Hi, the double quotes are only needed for Java so it knows you want to declare a String. The Stringobject itself doesnt contain the quotes!
Mark
Herb Schildt
Author
Ranch Hand

Joined: Oct 01, 2003
Posts: 239
Segal:

Expanding on Mark's comment, in Java, a string literal is represented in a program's source code by enclosing the desired string within quotes. In the compiled version of the program, a String object is created that corresponds to that string literal. This object does not include the quotes.

For example, consider this line:

Here, "a test string" is a string literal. However, what str refers at runtime will be a String object that contains the characters a test string. It will not include quotes. Thus, a quoted string is simply a source code mechanism.


For my latest books on Java, including my Java Programming Cookbook, see HerbSchildt.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String without double quotes