Exam 2: Console Input and Output
Exam 1: Getting Started45 Questions
Exam 2: Console Input and Output29 Questions
Exam 3: Flow of Control44 Questions
Exam 4: Defining Classes I45 Questions
Exam 5: Defining Classes II46 Questions
Exam 6: Arrays46 Questions
Exam 7: Inheritance43 Questions
Exam 8: Polymorphism and Abstract Classes43 Questions
Exam 9: Exception Handling45 Questions
Exam 10: File IO46 Questions
Exam 11: Recursion44 Questions
Exam 12: Uml and Patterns22 Questions
Exam 13: Interfaces and Inner Classes32 Questions
Exam 14: Generics and the Arraylist Class32 Questions
Exam 15: Linked Data Structures43 Questions
Exam 16: Collections,maps,and Iterators44 Questions
Exam 17: Swing I37 Questions
Exam 18: Swing II31 Questions
Exam 19: Java Never Ends26 Questions
Exam 20: Applets25 Questions
Select questions type
The statement: System.out.printf"%6.2f",597.7231);displays:
Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
B
What Java package includes the class Scanner?
Free
(Multiple Choice)
5.0/5
(30)
Correct Answer:
D
What do the format specifiers d,f,e,g,s and c represent?
Free
(Essay)
4.8/5
(44)
Correct Answer:
The format specifiers d,f,e,and g are all used for numeric representation.Specifier d represents a decimal integer,specifier f represents a fixed-point floating-point number,specifier e represents E-notation floating-point,and specifier g represents general floating-point in which Java secedes whether to use E-notation.
The format specifiers s and c are used for string and character representation,respectively.
The class NumberFormat allows you to specify a constant representing which country's currency format should be used.To use this constant you must import:
(Multiple Choice)
4.8/5
(38)
If there is no loss of efficiency in importing an entire Java package instead of importing only classes you use into your program,why would you not just import the entire package?
(Essay)
4.8/5
(43)
Valid arguments to the System.out object's println method include:
(Multiple Choice)
4.7/5
(45)
The method printf is used the same way as the method println but has the added feature that allows you to add formatting instructions.
(True/False)
4.8/5
(43)
Write Java statements to apply currency formatting to the number 100.Indicate the package you need to import.
(Essay)
4.9/5
(35)
Efficiency is lost in importing the entire package instead of importing the classes you use.
(True/False)
4.9/5
(40)
What does the following code output? DecimalFormat dfQuestion = new DecimalFormat"#0.##E0");
System.out.printlndfQuestion.format12.7896987));
(Multiple Choice)
4.9/5
(33)
What does the following code output? DecimalFormat percent = new DecimalFormat"0.00%");
System.out.printlnpercent.format0.308));
(Multiple Choice)
4.9/5
(36)
The printf method can be used to output multiple formatted values.
(True/False)
4.7/5
(34)
Write a Java program to create and display 57.32% using the DecimalFormat class.Include the necessary import statement to use the DecimalFormat class.
(Essay)
4.9/5
(39)
If a hyphen is added after the % in a format specifier,the output will be _________.
(Multiple Choice)
4.7/5
(43)
Explain the significance of the pattern string used by the DecimalFormat object,and give an example of a valid pattern.
(Essay)
4.9/5
(35)
Which statement or group of statements produces the output: Java programming is fun!
(Multiple Choice)
4.9/5
(38)
Write ONE Java statement to display your first and last name on two separate lines.
(Essay)
4.7/5
(36)
Showing 1 - 20 of 29
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)