| |

VerySource

 Forgot password?
 Register
Search
View: 1814|Reply: 12

Ask: how to know the ASCII code of a character

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-15 18:30:01
| Show all posts |Read mode
For example, how to know the asc code of ‘a’, I ’m a beginner, I hope everyone helps
Reply

Use magic Report

1

Threads

51

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-4-16 13:30:01
| Show all posts
97 A 65, 32 difference between uppercase and lowercase, +1 for B, take a look at this book or search online
Reply

Use magic Report

0

Threads

21

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-4-26 15:45:01
| Show all posts
package com.newsclan.udq;

public class Test {

/ **
* @param args
* /
public static void main (String [] args) {
// TODO Auto-generated method stub
byte a [] = "a" .getBytes ();
System.out.println (a [0]);
The
}

}
Reply

Use magic Report

1

Threads

14

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-4-29 02:45:01
| Show all posts
package com.newsclan.udq;

public class Test {

/ **
 * @param args
 * /
public static void main (String [] args) {
int i = 97;
System.out.println ((char) i);

}

}
Reply

Use magic Report

1

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-4-30 10:45:01
| Show all posts
public class c
{
public static void main (String [] args)
{
System.out.println ((int) '\n');
System.out.println ((int) '');
System.out.println ((int) 'a');
}
}



Results 10 32 97
Reply

Use magic Report

0

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-4-30 16:45:01
| Show all posts
Look up ASCII comparison table
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-2 15:15:02
| Show all posts
public class q {
  public static void main (String [] args) {
    Byte m = 'a';
    System.out.println ((int) m);

  }
}
Reply

Use magic Report

0

Threads

14

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-5-4 21:45:01
| Show all posts
public static void main (String [] args) {
char a = 'a';
System.out.println (a + 1-1);

}
}
Reply

Use magic Report

3

Threads

17

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-6-24 17:30:01
| Show all posts
Just convert to int
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-7-26 10:00:02
| Show all posts
Thank you everyone, I know it, thank you
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list