tilda java output

Hi,

I am trying below program

public class test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
exByte();
	}
	
	public static void exByte(){
		
		char tt='A';
		tt='\u223c';//tilda
		tt=0x223c;//hexa value of tilda
		System.out.println("tt is"+tt);
		System.out.println("tt is"+(int)tt);
	}

}

Open in new window


i got below output
tt is?
tt is8764


i expected tilda but got ? as out put
also why below statement
System.out.println("tt is"+(int)tt);
gave 8764.
where can i see all these list of values in binary integer hex for all the characters, numericals?

please advise
LVL 7
gudii9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
Your display device may be using an ASCII or ISO-8859 character set.
You might want to try
 tt=0x7e;
0
CEHJCommented:
http://technojeeves.com/index.php/aliasjava1/16-javasystemproperties

file.encoding

is the property you should print. Then examine the encodings for that character set by googling
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mccarlIT Business Systems Analyst / Software DeveloperCommented:
also why below statement
System.out.println("tt is"+(int)tt);
gave 8764.
Because 0x223C in HEX equals 8764 in decimal, and Java's representation of an integer (when converting it to a string which you are implicitly doing on line 17) is as a decimal.
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

gudii9Author Commented:
public class test {

      /**
       * @param args
       */
      public static void main(String[] args) {
            // TODO Auto-generated method stub
exByte();
      }
      
      public static void exByte(){
            
            char tt='A';
            tt='\u223c';//tilda
            tt=0x7e;//hexa value of tilda
            System.out.println("tt is"+tt);
            System.out.println("tt is"+(int)tt);
      }

}

above gave output
tt is~
tt is126
0
gudii9Author Commented:
Your display device may be using an ASCII or ISO-8859 character set.
You might want to try
 tt=0x7e;

how do i know which one is being used by device( what you mean by device ? windows dell laptop i am using and elipse is ide i am working to run) please advise
0
gudii9Author Commented:
public class Props {
    /**
     *  The main program for the Props class
     *
     * @param  args  One or no arguments. If one,
     * the key of one system property, the value
     * of which you want to know. If none, all
     * properties are listed
     *
     */
    public static void main(String[] args) {
        if (args.length > 0) {
            for (int i = 0; i < args.length; i++) {
                System.out.println(System.getProperty(args[0]));
            }
        } else {
            System.getProperties().list(System.out);
        }
    }
}

Open in new window


i ran above program i do not find ascii or is0-8859.
please advise
0
CEHJCommented:
i ran above program i do not find ascii or is0-8859.
please advise
So what DID you get?
0
gudii9Author Commented:
i see lot of other things when i ran on office laptop. i will try on personal laptop and post.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.