{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Example3_16A - %n" x String.format"The value of y...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import javax.swing.JOptionPane; i public class Example3_16A { public static void main(String[] args) { double x = 15.674; double y = 235.73; double z = 9525.9864; int num = 83; JOptionPane.showMessageDialog(null, String.format("The value of x with two decimal places = %.2f
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %n", x) + String.format("The value of y with two decimal places = %.2f %n", y) + String.format("The value of z with two decimal places = %.2f %n", z), "Formatting with the String Method format", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online