Question: Help with these two Java methods please * @param str: assume it's not null * @param start: starting index (assume 0

Help with these two Java methods please

* @param str: assume it's not null

* @param start: starting index (assume 0 <= start < str.length())

* @param end: ending index (assume 0 <= end < str.length())

* @return true if string is numeric from start to end.

* return true if start > end

*

* HINT: you can check a character ch is a digit by checking

* Character.isDigit(ch) and similarly that it's not a digit using

* !Character.isDigit(ch)

* for example,

* if str = "hello world!", start = 0, end = 11, return false

* if str = "hello world!", start = 6, end = 4, return true

* if str = "0123456789", start = 0, end = 9, return true

* if str = "+5678", start = 1, end = 3, return true

* if str = "+5678", start = 0, end = 3, return false

*/

public static boolean isNumeric(String str, int start, int end) {

return false; //to be completed

}

/**

* @param list

* remove any duplicates from the list, retaining only the last occurrence of

* every item in the list

* if list = [1,2,1,3,7,4,5,7,7,7], it should become [2,1,3,4,5,7]

* if list = [8,8,8,8], it should become [8]

* if list = [1,2,7], it should stay [1,2,7]

*/

public static void removeDuplicates(ArrayList list) {

//to be completed

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!