Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
Programmer Certification (OCPJP)
what difference '\' and '/'
Anonymous
Ranch Hand
Posts: 18944
posted 24 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
class My
{
public static void main(
String
argc[])
{
String a="abcd" +
'/' + // replace '/' with '\'
"efgh";
System.out.println(a);
}
}
for '/' prints abcd/efgh
for '\' gives invalid charcter
why ? can any body explain please
suresh
Anonymous
Ranch Hand
Posts: 18944
posted 24 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The compiler expects escape sequences after '\' like '\n',
'\f','\r'. I think it also accepts some UNICODE characters with '\'.
Good Luck
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how to parse a string
Is Polymorphic Bean reference in conformity with Java polymorphism
Parse text between angle brackets
String manipulation in XSLT programming
Regular expression to take last word in a string
More...