Question: I was studying a book and I found this :

```
int tiles = ch - 'A';

```

where `ch` is a character.

What I dont understand is how did operating between two characters result an integer?

Answer: 
A `char` variable is actually stored in memory as a numeric value. That number represents a specific character (`a`, `b`, `é`, ...), according to a specific codification (usually the [ASCII Table](http://www.asciitable.com/)). 

For instance: 

```
Decimal    Char
----------------
65         A
66         B
...        ...

```

You can use a `char` variable as if it was a numeric variable. It will be automatically cast and will have the numeric value representing the `char`. And viceversa, a numeric value can be interpreted as a `char`. 

```
// The ASCII code for 65 is A
int result = 100 - 'A';
System.out.println ("100 - A is " + result); // Prints 35

System.out.println("ASCII code for 65: " + (char)65); // Prints A

```

Here's a [**Ideone demo**](http://ideone.com/h2F8o0) of the code above.

Getting into detail, according to the [JLS](http://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.1.2), sections [5.6.2. Binary Numeric Promotion](http://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.6.2), and [5.1.2. Widening Primitive Conversion](http://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.1.2) : 

> 
> 19 specific conversions on primitive types are called the widening
>  primitive conversions: 
> 
> 
> * ...
> * char to int, long, float, or double
> * ...
> 
> 
>
Every character has an ascii value (an integer). In other words, every character has a number that represents it. Doing the operation 'ch - A' will yield you with a number between 0 and 26, assumming 'ch' is between A and Z.