Hexadecimal number format - Java Language Basics

Java examples for Language Basics:int

Introduction

Hexadecimal number format uses 16 digits, 0-9 and A-F (or a-f).

The case of the letters A to F does not matter.

The following are the examples of using int literals in hexadecimal format:

int num1 = 0x123; 
int num2 = 0xdecafe; 
int num3 = 0x1A2B; 
int num4 = 0X0123;

Related Tutorials