0% found this document useful (0 votes)
19 views2 pages

Java String Functions in 2D Arrays

Uploaded by

athravasade
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)
19 views2 pages

Java String Functions in 2D Arrays

Uploaded by

athravasade
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

Experiment 6B

Aim – Program on 2D array , string functions

Program -

import [Link];
public class strm
{
public static void main(String args[])
{
//String length
String s = "Java is object oriented programming ";
[Link]("String length = "+[Link]());

//String concatenation
String s1 ="Java";
String s2 ="Programming";
[Link]("String Concatenation 1 = "+(s1+s2));
[Link]("String Concatenation 2 = "+[Link](s2));

//String CharAt
[Link]("\n String CharAt(1) : "+[Link](1));
[Link]("\n String CharAt(6) : "+[Link](6));

//CompareTo
[Link]("CompareTo Result = "+[Link](s2));
[Link]("CompateTO Result = "+[Link](s1));

//contains
[Link]("\n Java is a object oriented Programming "+ [Link](s1));
[Link]("\n Java is a objet oriented programming "+ [Link](s2));

//indexof()
[Link]("\n Index of 'o' is "+[Link]('o'));

//equals()
[Link]("\n String first and second are equal = "+[Link](s2));

//lower and upper case


String s3 = "INHERITANCE";
[Link]("\n Upper case of String 1 = "+[Link]());
[Link]("\n Lower case of String 3 = "+[Link]());

}
Experiment 6B

Output -

You might also like