Computers and Technology

IN JAVAHW4_P2 - MyStringThe String class is provided in the Java library. Provide your own implementation for the following methods (name the new class MyString):DO NOT USE THE STRING OBJECT AND ITS METHODS. IMPLEMENT THEM ALL AGAIN YOURSELF!**You can use char[] and Character object. public MyString(char[] chars);public char charAt(int index);public int length();public MyString substring(int begin, int end);public MyString toLowerCase();public boolean equals(MyString s);public static MyString valueOf(int i);public char[] toChars();Use the following class driver with no modifications to it!import java. util.*;import java. lang.*;import java. io.*;class DriverMain{public static void main(String[] args) {MyString s1 = new MyString(new char[] {'A', 'B', 'C'});System. out. println(s1.length());System. out. println(s1.charAt(1));MyString s2 = s1.substring(0,2);System. out. println(s2.toLowerCase().equals(new MyString(new char[] {'a', 'b'})));char[] chars = MyString. valueOf(345).toChars();for (int i = 0; i < chars. length; i++) {System. out. print(chars[i]);}}}---And use the following class that was refered to in mainclass MyString { public MyString(char[] chars){ }public char charAt(int index){ }public int length(){ }public MyString substring(int begin, int end){ }public MyString toLowerCase(){ }public boolean equals(MyString s){ }public static MyString valueOf(int i){ }public char[] toChars(){ } }PLEASE follow the instructions that are provided and comment the code so I can understand it better!I'm really confused about this assignment and need as much help as possible!

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 03:00, greenhappypiggies
Using a conditional expression, write a statement that increments numusers if updatedirection is 1, otherwise decrements numusers. ex: if numusers is 8 and updatedirection is 1, numusers becomes 9; if updatedirection is 0, numusers becomes 7.
Answers: 1
image
Computers and Technology, 24.06.2019 12:30, stephanieanaya7
Why does the pc send out a broadcast arp prior
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, CarlosParker99
Think of a spreadsheet as a giant calculator spread of paper chart data collector
Answers: 2
image
Computers and Technology, 24.06.2019 20:00, Cookie320
Write c++programs for the following problem: let the user enter two numbers and display which is greater. !
Answers: 1
Do you know the correct answer?
IN JAVAHW4_P2 - MyStringThe String class is provided in the Java library. Provide your own implement...

Questions in other subjects:

Konu
English, 12.03.2021 22:50