Code example for DecimalFormatSymbols

Methods: cloneequalssetNaN

        DecimalFormatSymbols fs = new DecimalFormatSymbols(Locale.US);
        DecimalFormatSymbols fsc = (DecimalFormatSymbols) fs.clone();
        assertEquals(fs.getCurrency(), fsc.getCurrency());
        // case 2: Compare of clones 
        fs = new DecimalFormatSymbols();
        DecimalFormatSymbols fsc2 = (DecimalFormatSymbols) (fs.clone());
        // make sure the objects are equal 
        assertTrue("Object's clone isn't equal!", fs.equals(fsc2));
        // case 3: 
        // change the content of the clone and make sure it's not equal 
        // anymore 
        // verifies that it's data is now distinct from the original 
        assertTrue("Object's changed clone should not be equal!", !fs.equals(fsc2));
    public void test_setCurrencySymbolLjava_lang_String() { 
        assertEquals("Returned incorrect CurrencySymbol symbol", "$", dfs.getCurrencySymbol());
Contextual code suggestions in your IDE  Get Codota for Java