0% found this document useful (0 votes)
1 views17 pages

Day 06 Java Task

NA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views17 pages

Day 06 Java Task

NA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Courses Java/Selenium/Python/Javascript

Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
String
DAY-6:
1. String functions
2. Literal String
3. Non Literal String
4. Mutable String
5. ImMutable String
QUESTIONS (Theory)
1. What is mean by string?
2. How to find length of the string?
3. How to find partcular character in string?
4. How to split the string?
5. What is difference between literal String and non literal string?
6. What is mutable and immutable string?
7. Difference between stringbulider and stringbuffer?
8. Method name to identify memory location?
9. What are the string functions available in java?
10. What is difference between charAt() and contains() method?
11. What is the return type of compareTo()
12. Where the Literal String and non literal String stores?
13. What is mean by ASCII value?

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
QUESTIONS (Programs)
QUESTION 1:
Description: Find the length of the below string
String 1: GreensTechnology
String 2: SeleniumAutomationtool
String 3: RamSarath
String 4: j a v a p r o g r a m
String 5: 7639416267

QUESTION 2:
Description: Find the particular character index in the given string
String 1: GreensTechnology
Find the last index of o

String 2: SeleniumAutomationtool
Find the index of o

String 3: RamSarath
Find the index of n
String 4: j a v a p r o g r a m
Find the last index of (emptyspace)

String 5: 7639416267
Find the index of 8

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
Question 3:
Description: Find the particular character in the given string
String 1: GreensTechnology
print the character h

String 2: SeleniumAutomationtool
print the character o

String 3: RamSarath
print the character a

String 4: j a v a p r o g r a m
print the character p

String 5: 7639416267
print the character 3

QUESTION 4:
Description : Get two input from user and check the equality
: print in the output whether it is Equal or not
Example:
--------
Input :
String 1 : Java
String 2 : Java

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel

Example:
---------
Input :
String 1 : Java
String 2 : java

Example:
---------
Input :
String 1 : Green Technology
String 2 : GreenTechnology.

Example(use equalsIgnoreCase):
---------
Input :
String 1 : Java
String 2 : java

Example(use equalsIgnoreCase) :
---------
Input :
String 1 : Ramsarath
String 2 : ramsarath

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel

QUESTION 5:
QUESTION 5.1:

Description: Get the email id from the user and verify '@' is present or
not?

Example:
------------
Input = ramsarath451@[Link]
Output = valid email id
QUESTION 5.2:

Description:Get the address from the user and verify "pincode" is


present or not?
Example:
------------
Input = 5-35-2a,ramsarath,chennai
Output = invalid address
QUESTION 5.3:

Description:Get the email from the user and verify '@' is present or not
and return true or false?
Example:
------------
Input = xavier24@[Link]
Output = True/False

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


– Ramsarath,Xavier,Palanivel
Trainers
QUESTION 5.4:

Description:Get the phonenumber from the user and verify any character
is present or not .
If character is present return invalid number

Example:
------------
Input = 763a941g6267
Output = False

QUESTION 6:
Description:Get the phonenumber from the user .
If phonenumber exceeds greater than 10 then return invalid
number

Example:
--------
Input = 76394162677
output = invalid
Example 2:
---------
Input = 7639416267
Output = valid

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
QUESTION 7:
QUESTION 7.1:

Description: Given string as "Welcome to java class" and replace java


into sql.

Example:
-----------
Input = Welcome to class java
output = Welcome to class sql

QUESTION 7.2:

Description: Given string as "Greens Perungudi"and replace Perungudi


into Velacherry.

Example:
-----------
Input = Greens Perungudi
Output = Greens Velacherry

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


– Ramsarath,Xavier,Palanivel
Trainers
QUESTION 7.3:

Description: Given String as "Welcome to java class" and Replace space


into '#'
Example:
----------
input:Welcome to java class
output:Welcome#to#java#class
QUESTION 7.4:

Description: Get the email from the user and verify "gmail" is present or
not.
If present replace that gmail into yahoo
Example:
------------
Input = ramsarath24@[Link]
Output = ramsarath24@[Link]
QUESTION 7.5:

Description: Get the address from the user and verify "pincode" is
present or not.
If present replce the pincode with empty space

Example:
------------
Input = 5-35-2a,ramsarath,Aruppukottai,pincode-626101
Output = 5-35-2a,ramsarath nivas,Aruppukottai

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
QUESTION 8
QUESTION 8.1

Description:Get the input from the user and print that word in lowercase

Example:
--------
Input = RAMSARATH
Output = ramsarath

QUESTION 8.2

Description:Get the input from the user and print that word in Uppercase

Example:
--------
Input = ramsarath
Output = RAMSARATH

QUESTION 8.3

Description:Convert all small letter and into capital letter


Example:
----------
Input = WelcomE
Output = wELCOMe

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


– Ramsarath,Xavier,Palanivel
Trainers
QUESTION 8.4

Description:Find the number of uppercase count and lowercase count in


the given String
Example:
Input = WelComeToJava
Output:
UpperCase=4
LowerCase=9
QUESTION 9
QUESTION 9.1

Description: Given String as "Welcome to java class" and verify whether


the given string startsWith welcome
Example:
-----------
Input = Welcome to class java
output = True

QUESTION 9.2

Description: Given String as "Hai i am ramsarath" and verify whether


the given string startsWith welcome
Example:
-----------
Input = Hai i am ramsarath
output = False

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


– Ramsarath,Xavier,Palanivel
Trainers
QUESTION 9.3

Description: Given String as "Welcome to java class" and verify whether


the given string endsWith class

Example:
-----------
Input = Welcome to java class
output = True

QUESTION 9.4

Description: Given String as "Welcome to java class" and verify whether


the given string endsWith java

Example:
-----------
Input = Welcome to java class
output = False

QUESTION 9.5

Description: Given String as "Welcome to java class" and verify whether


the string is empty or not
Example:
-----------
Input = Welcome to java class
output = False

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


– Ramsarath,Xavier,Palanivel
Trainers
QUESTION 9.6

Description: Given String as "" and verify whether the string is empty or
not
Example:
-----------
Input = ""
Output = False
QUESTION 10
Description : Get two input from user and Compare

Example
---------
String 1 : ramsarath
String 2 : Ramsarath

Example
---------
String 1 : ram
String 2 : Ramsarath

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
QUESTION 11
QUESTION 11.1

Description : Generate the two literal string and find the


identityHashCose()

Example
---------
String 1 : Ramsarath
String 2 : Ramsarath
QUESTION 11.2

Description : Generate the two non literal string and find the
identityHashCose()

Example
---------
String 1 : Ramsarath
String 2 : Ramsarath
QUESTION 11.3

Description : Generate the three non literal string and find the
identityHashCose()
Example
---------
String 1 : Ram
String 2 : Sarath
String 3 : RamSarath

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


– Ramsarath,Xavier,Palanivel
Trainers
QUESTION 11.4

Description : Generate the three literal string and find the


identityHashCose()

Example
---------
String 1 : Ram
String 2 : Sarath
String 3 : RamSarath

QUESTION 12
QUESTION 12.1

Description: Given String as "Welcome to java class" and split it by


space.

Example:
--------
Input :Welcome to java class
Output:
-------
Welcome
to
java
class

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


– Ramsarath,Xavier,Palanivel
Trainers
QUESTION 12.2

Description: Given String as "Welcome to java class" and split it by l

Example:
--------
Input :Welcome to java class
Output:
-------
We
come to java c
ass

QUESTION 13
QUESTION 13.1

Description: Given String as "Welcome to java class" and generate a


substring.

Example:
--------
Input :Welcome to java class
Output:
-------
Welcome

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
QUESTION 14
Example:
-----------
Description: Given String as "Welcome" and the number of consonant
count and vowels count

Example:
Input = Welcome
output:
-------
vowels = 3
consonant = 4

QUESTION 15:
Description: Find the count of caps,small,number and special character
in given string
Example:
-----------
Input : Welcome To Java class @123
Output
------
caps count :3
small count :15
number count:3
Special char:5

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us
Courses Java/Selenium/Python/Javascript
Offered here: Full-Stack Developer/API/Appium

For Enquiry Call Us: 8939982246


Trainers – Ramsarath,Xavier,Palanivel
QUESTION 16
Description: Replace all vowels char into '@'

Example:
----------
Input = Welcome
Output = W@lc@m@

Location : 51-A, 2nd floor, Velachery Rd, Dhadeswaram Nagar, Velachery, Chennai, Tamil Nadu 600042
Follow us On: greens_technologies_chennai Scan Here
greens_technologies_chennai To Reach Us

You might also like