Scanner radix() in Java

radix(): This method is available in java.util.Scanner class of Java.

Syntax:

int java.util.Scanner.radix()

This method returns this scanner's default radix.

Parameters: NA

Returns: the default radix of this scanner.

Exceptions: NA

Approach

Java

import java.util.Scanner;

public class Scannerradix {
    public static void main(String[] args) {

        String source = "Hello World";
        Scanner scanner = new Scanner(source);

        System.out.println(scanner.radix());

        scanner.close();
    }
}

Output:

10


No comments:

Post a Comment