Home Tutorial Java Scjp Part12 SCJP Module-12 Question-4

 
 

SCJP Module-12 Question-4
Posted on: July 20, 2010 at 12:00 AM
The Sample program given below will check your understanding of number formating in Java.

Given below the sample code :

1. double in= 314159.26;
2. NumberFormat nof = NumberFormat.getInstance(Locale.ITALIAN);
3. String str;
4. //insert code here

Which code should be inserted at line 4 to set the value of b to 314.159,26?

1.str = nof.parse(in);

2.str = nof.format(in);

3.str = nof.equals(in);

4.str = nof.parseObject( in);

Answer

(2)

Related Tags for SCJP Module-12 Question-4:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.