109.String formatting (Document)

109.String formatting (Document)

Professional Development

28 Qs

quiz-placeholder

Similar activities

Java/ Фінальний тест

Java/ Фінальний тест

9th Grade - Professional Development

31 Qs

Unit4_Servlets_Exam1

Unit4_Servlets_Exam1

Professional Development

24 Qs

Iniciemos con Python

Iniciemos con Python

Professional Development

25 Qs

Java Chapter 11 Review Questions

Java Chapter 11 Review Questions

Professional Development

24 Qs

Java AWT Swings Quiz 1

Java AWT Swings Quiz 1

Professional Development

24 Qs

First Quiz

First Quiz

Professional Development

23 Qs

AJWT MCQ Quiz

AJWT MCQ Quiz

Professional Development

25 Qs

Mid Test React JS

Mid Test React JS

Professional Development

25 Qs

109.String formatting (Document)

109.String formatting (Document)

Assessment

Quiz

Computers

Professional Development

Hard

Created by

ANIL KUMAR

Used 1+ times

FREE Resource

28 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How can you format strings in Java?
Using concatenation
Using printf()
Using split()
Using toString()

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the purpose of %s and %d in Java string formatting?
Decimal and string formatting
String and decimal formatting
Double and string formatting
String and date formatting

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How does the String.format() method work in Java for string formatting?
Modifies original string
Returns a new formatted string
Converts string to uppercase
Removes whitespace from a string

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What does %9s mean in Java string formatting?
Left-align string
Right-align string
Center-align string
Limit string length to 9 characters

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How can you format a string to display two decimal places in Java?
%2f
%2d
%.2f
%.2d

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Explain the significance of \\s+ and \\s in Java.
Matches whitespace characters
Matches numeric characters
Matches special characters
Matches alphabetic characters

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What does the asterisk '*' mean in Java string formatting?
Left-align
Right-align
Center-align
Replace with asterisk

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?