109.String formatting (Document)

109.String formatting (Document)

Professional Development

28 Qs

quiz-placeholder

Similar activities

fundamentos de javascript

fundamentos de javascript

Professional Development

25 Qs

BTEC Coding & Logic

BTEC Coding & Logic

12th Grade - Professional Development

24 Qs

UG Code Breaker Challenge Round-1

UG Code Breaker Challenge Round-1

Professional Development

30 Qs

Golang Fiber with GORM

Golang Fiber with GORM

Professional Development

24 Qs

Quest-python

Quest-python

Professional Development

33 Qs

OCA Unit 1

OCA Unit 1

11th Grade - Professional Development

23 Qs

Test Faham?

Test Faham?

12th Grade - Professional Development

23 Qs

JSON

JSON

Professional Development

23 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?