in java 1. Exercise Write a class called StringDemo. The class should …. a) use the JOptionPane to read in the sentence

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

in java 1. Exercise Write a class called StringDemo. The class should …. a) use the JOptionPane to read in the sentence

Post by answerhappygod »

in java
1. Exercise Write a class called StringDemo.
The class should ….
a) use the JOptionPane to read in the sentence "I love learningJava Programming". Do not hard code it into your program.
b) print the length of the input string using the length()method in the String class
c) print the words "Java Programming" by using the substring()method with only one parameter
d) replace the word "Java" with "C++" in the input stringand print the result of this replacement
e) use only the substring() and concat() methods in theString class to print out the sentence : Java Programming is tolove learning The only two words you need to add are "is to". Theother words need to be taken from substringing the inputstring.
You may not use the concatenation operator ‘ + ’.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply