DecimalFormatSymbols SetDigit() Example
Sets the character used for a digit in a pattern.
DecimalFormatSymbolsclass SetDigit() method example. This example shows you how to use SetDigit() method.This method Sets the character used for a digit in a pattern.
Here is the code:-
/**
* @Program that Sets the character used for a digit in a pattern.
* SetDigit.java
* Author:-RoseIndia Team
* Date:-14-Jun-2008
*/
import java.text.*;
public class SetDigit {
public static void main(String[] args) {
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
char c = dfs.getDigit();
System.out.println("Character used for a digit in a pattern: " + c);
dfs.setDigit('@');
System.out.println("Character used for a digit in a pattern: " +dfs.getDigit());
}
} |
Output of the program:-
Character used for a digit in a pattern: #
Character used for a digit in a pattern: @ |
|