DecimalFormatSymbols SetNaN() Example
Sets the string used to represent "not a number".
DecimalFormatSymbolsclass SetNaN() method example. This example shows you how to use SetNaN() method.This method Sets the string used to represent "not a number".
Here is the code:-
/**
* @Program that Sets the string used to represent "not a number".
* SetNaN.java
* Author:-RoseIndia Team
* Date:-14-Jun-2008
*/
import java.text.*;
import java.util.*;
public class SetNaN {
public static void main(String[] args) {
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
//Gets the string used to represent "not a number".
String c = dfs.getNaN();
System.out.println("The string used to represent not a number is: " + c);
dfs.setNaN("##");
System.out.println("The string used to represent not a number is: " +dfs.getNaN());
}
} |
Output of the program:-
The string used to represent not a number is: �
The string used to represent not a number is: ## |
|