PRO192_-_PE_-_SP_2024_1494.webp
O

PRO192_-_PE_-_SP_2024_1494.webp

  • Media owner Obanai89
  • Ngày thêm
OUTPUT:
(E8) (G,56) (E,8) (F,47) (E,56) (C,65) (B,74) (A,83)
Question 4:
(2 marks) The interface IString below is already compiled and given in byte code format, thus you can use it without creating IString.java file.
public interface IString {
public int f1(String str);
public String f2(String str);
}
Write a class named MyString, which implements the interface IString. The class MyString implements methods f1 and f2 in IString as below:
f1: Count of words that the first and last characters are letters and the rest are numbers (word = a string without space(s)).
f2: Return the string by replacing odd-numbered characters that appear more than once in the string by the first letter in the string (keep the first odd-numbered character that satisfies the codition; Assume that there are at least 1 letter in the string).
The program output might look something like:
5 of 5
Paper No: 7
1. Test f1()
1. Test f1()
Zoom
FUO
85%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
Obanai89
Ngày thêm
Lượt xem
2,927
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_PE_-_SP_2024_1494.webp
File size
173.7 KB
Dimensions
1920px x 990px

Share this media

Back
Bên trên Bottom