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

Java Programming

The document presents a programming assignment involving string manipulation in Java. It includes various operations such as comparisons, indexing, and substring extraction on given string variables. The results of each operation are provided alongside the corresponding code snippets.

Uploaded by

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

Java Programming

The document presents a programming assignment involving string manipulation in Java. It includes various operations such as comparisons, indexing, and substring extraction on given string variables. The results of each operation are provided alongside the corresponding code snippets.

Uploaded by

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

COMPUTER PROGRAMMING 1 : ASSIGNMENT

String s1 = “Welcome to Java”;

String s2 = “Programming isa fun”;

String s3 = “Welcome to Java”;

(a). s1 == s2 (l).
[Link](“o”,15)

result: False result: 6

(b). s2 == s3 (m). [Link]()

result: False result: 16

(c). [Link](s2) (n). [Link](5)

result: False
result: me to java

(d). [Link](s3) (o). [Link](5,11)

result: True result: me to

(e). [Link](s2) (p).


[Link](“Wel”)

result: >0(Positive Value) result: True

(f). [Link](s3) (q).


[Link](“java”)

result: <0(Negative Value) result: True

(g). [Link](s2) (r). [Link]()

result: 0 result: welcome to java

(h). [Link](0) (s). [Link]()

result: W result: WELCOME TO


JAVA

(i). [Link](‘j’) (t). [Link](s2)

result: -1 result: Welcome to


Java Programming is fun

(j). [Link](“to”) (u). [Link](s2)


result: 8 result: False

(k). [Link](‘a’) (v). “\t Wel \t”.trim()

result: 14 result: Wel

You might also like