String, text, numbers, I/O I part
String a = "" +
                    " " +
                    " 

this is html.

" +
                    " " +
                    "";
 I am doing some servlet programming and I need to include a few " in a string.
How can I do this?
Answer: By using the escape character \ like so:
String s = "\"";
 I cannot find the method to convert a binary number to an int. I used
Integer.toBinaryString to get a decimal to binary but I don t know how to to convert it
back.
Answer: Try using Integer.parseInt(String s, int radix) with radix = 2
that should do your job.
 How do I launch a native Document by its Associated MIME Type? For example,
I would like to ask the  operating system  what application is associated with .DOC
and then launch it.
Answer: On WinNt,
String docName = "c:\\someyourdir\\nameofdoc.doc";
Runtime.getRuntime().exec("cmd.exe /c "+docName);
 Q: How do I indicate Unicode characters that cannot be represented in ASCII,
such as o?
Answer: from "Java Tutorial
(http://java.sun.com/docs/books/tutorial/i18n/text/convertintro.html) 
"To indicate Unicode characters that cannot be represented in ASCII, such as o, we
used the \uXXXX escape sequence. Each X in the escape sequence is a
hexadecimal digit. The following example shows how to indicate the o character with
an escape sequence: 
String str = "\u00F6";
char c =  \u00F6 ;
Character letter = new Character ( \u00F6 ); "
 When I tried to read one string representing boolean value and convert it into
boolean it didn t work. Finally I found that Java API has a bug!
I wrote the program that uses redaing ini file settings for initialization. All settings in a
file are strings. I am converting them to appropriate type during reading. When I tried
to read one string representing boolean value and convert it into boolean it didn t
work. Finally I found that Java API has a bag:
boolean x = true;
getBoolean(x);
will show false!!!!
Why Java has method that doesn t work? Is it bug in Java or I am stupid? 
file:///F|/a_jsite/350_tips/stings_text__date_numbers_io I.htm (4 of 7) [2001 07 08 11:24:59]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved