# literal Loop

• October 10th, 2009, 05:32 AM
chronoz13
literal Loop
what is literal loop?
I saw this in this URL: Beginner Level

and inside of this topic here's a sample program:

Code :

```public class Sample {   public static void main(String[] args) {   int count = 0;   for (int i = 0x0EF; i <= 0647; i++)   { count++; } System.out.println("The loop looped " + count + " times."); } }```

question:

1.) i dont know the value of '0x0ef' , whats that supposed to mean?

2.) what is literal loop? is it some kind of LOGIC in making a loop? or its just the title of the topic? :confused:8->
• October 10th, 2009, 05:41 AM
Json
Re: literal Loop
1. The value 0x0ef is a hexadecimal number and you can just use your windows calculator to see what it is or just use the code I posted in another thread.

Code :

` System.out.println("From hex: " + Integer.decode("0x0ef"));`

2. A literal loop would be a loop that uses the octal or hexadecimal numbers instead of decimal numbers.

Just have a look at the literal definition on the same page you linked to: Definition for the term: Literal

// Json
• October 10th, 2009, 09:19 PM
chronoz13
Re: literal Loop
if the hexadecimalas are represented by preceeding charcter '0x' and octal are represented by '0' why is it in java hexadecimals are
represented by sharp('#')?

are they similar?
• October 10th, 2009, 11:03 PM
chronoz13
Re: literal Loop
... I override the method .decode() .. there's a '0x' preceeding character for hexadecimal conversion...