answersLogoWhite

0


Best Answer

char a = 'A';

System.out.println((int)a);

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you calculate ascii value in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a Java program to get the ASCII value of the given number?

If you look up the ASCII values for digits, you'll see that 0 = 48, 1 = 49... 9 = 57. So it's a simple matter of adding 48 to your digit to find out the ASCII value for it.


WAP in java to take alphabet and print ascii value for it?

Remember that chars in Java are just a special version of ints. Cast the char as an int and you get the Unicode value for it. Fortunately, the group of characters including letters and numbers have the same value in both encoding systems. for (char letter = 'a'; letter <= 'z'; ++letter) { System.out.println("ASCII of " + letter + " = " + (int) letter); }


How to print a symbol in Java using the ASCII value?

In order to print a character using its ASCII value, you need to first assign it to a char value like this: char c = (char) 65; In this example, we are casting the int 65 to a char, which converts it to an 'A', since 65 is the ASCII value for the capital letter 'a'. Next, you can print it out if you want: System.out.println(c); That's pretty much all there is to it!


What does Java use instead of ASCII?

ASCII and Java are 2 totally different things. ASCII is a naming convention where a certain letter, number, or punctuation mark is a specific keyboard code (Carriage Return, CR, is code 31, Line Feed 14, Capital A 96). Java is a programming language that handles text in multiple formats as needed, Unicode, EBDIC, ASCII. The two are not intertwined.


What is ASCII value of 0?

The ascii value of zero - is 48.


What is ASCII value of 5?

Ascii value of 5 is 53.


What is the ascii value for c?

The ASCII value for "C" is 67, for "c", 99.


What is the ASCII value of 92?

\ is the character for 92 in ASCII.


What is the best platform for the java source code for learning?

Takeoff Projects will be able to offer you an inventory of the simplest Java projects with ASCII text files for beginners which will surely improve your skills both in desktop and web development using our Java projects with ASCII text files.


What is the ASCII value of a?

deepak


What is the decimal value of the ASCII letter K?

The ASCII value of capital K is 75. For a small k it is 107.


Ascii value of 255?

ASCII standardizes characters between 0 and 127.