bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Scanner radix() Method

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Java Scanner radix() Method?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

// ___ a scanner object Scanner myObj = new Scanner("A string to scan");
3Order

Put the learning moves in the order that makes the concept easiest to apply.

Show the radix that is currently being used by the scanner:
Definition and Usage
Java Scanner radix() Method

❮ Scanner Methods

Example

Show the radix that is currently being used by the scanner:

// Create a scanner object Scanner myObj = new Scanner("A string to scan");
// Display the radix (defaults to 10) System.out.println(myObj.radix());

Definition and Usage

The radix() method returns a number indicating the radix that the scanner uses to interpret whole numbers. The radix specifies how many different symbols can be used to represent each digit in a number. For example, a radix of 16 would allow the symbols 0 to 9 and A to F to be used as digits.

Syntax

public int radix()

Technical Details

Returns:An int value representing the radix used by the scanner.

❮ Scanner Methods

Previous

Java Scanner nextShort() Method

Next

Java Scanner reset() Method