PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
successful_man

PRO192_-_SU_2023_-_Block_5_-_FE_735.webp

9
(Choose 1 answer)
A. EQUAL NOT EQUAL
B. NOT EQUAL
C. There is a compile error in the program.
D. EQUAL
}
What is the output when you try to compile and run the following program?
public class Main {
public static void main(String argv[]){
String s = "Hi there";int pos = s.indexOf(" ");
String r = s.substring(0, pos);
String s2 = new String(new char[] {'H',''});
if(r.equals(s2))
System.out.println("EQUAL");
else System.out.println("NOT EQUAL");
System.out.println();

Thông tin

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

Image metadata

Filename
PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
File size
54.2 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom