Question: why, 

```
System.out.println(Integer.parseInt("17", 8));

```

print out: **15**

and, 

```
System.out.printf("%o", 17);

```

print out: **21**

Aren't they supposed to return octal value of 17?

Answer: 
Your first example converts the octal value 17 to decimal, which is 15.

Your second example converts the decimal value 17 to octal, which is 21.

If you modify your second example to use `017` (octal 17), you'll get the same result.
```
System.out.printf("%o", 17);

```

This is used to convert an integer into its octal value

```
System.out.println(Integer.parseInt("17", 8));

```

This converts string(ocatal value) to integer.