0% found this document useful (0 votes)
2 views

5. String Practice questions

The document contains practice questions for Java programming. It includes tasks such as checking the number of digits in an integer, determining if a string is a palindrome, reversing words in a string, encrypting a string, and counting lowercase letters, uppercase letters, and digits in a given string. Each question provides input examples and expected output formats.

Uploaded by

shanthiraaja143
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

5. String Practice questions

The document contains practice questions for Java programming. It includes tasks such as checking the number of digits in an integer, determining if a string is a palindrome, reversing words in a string, encrypting a string, and counting lowercase letters, uppercase letters, and digits in a given string. Each question provides input examples and expected output formats.

Uploaded by

shanthiraaja143
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Practice questions:

note: use scanner to get input from user:

1.Write a java program to check the given number is one digit or two digit or three
digit number etc:(where input
0<=n<=99999

input: 6
output: It is one digit number

input:999
output: It is three digit number

2.Write a java program to check given string is palindrome or not?

input string: "level"


output: It is palindrome string

input string: "sample"


output: It is not palindrome string

3.Write a java program to reverse each word in a string

input string: "this is sample"


output: siht si elpmas

4.Write a java program to encrypt the given string

input string:"sample"
output: weqtpi

input string:"abcd"
output: efgh
5.Write a java program to find the lowercase letter count ,uppercase letter count
and digit count.

note : input string contains only alphabets and numbers

input string:"abcF45RGh"
output: 4,3,2

You might also like