试题详情
- 单项选择题 class Sock2 { String color; public boolean equals(Object o) { return color.equals(((Sock2)o).color); } } class TestSocks { public static void main(String [] args) { Sock2 s1 = new Sock2(); s1.color = "blue"; Sock2 s2 = new Sock2(); s2.color = "blue"; if (s1.equals(s2)) System.out.print("equals "); if (s1 == s2) System.out.print("== "); } } 结果为:()
A、==
B、equals
C、equals ==
D、无结果输出
- B
关注下方微信公众号,在线模考后查看
热门试题
- 下面哪些类型属于Java基本数据类型()
- 一个源文件中可以包含多个公共类
- Which activity
- What is th
- What is th
- class Order3&e
- 下面哪些类型实现了Comparable接
- What is th
- 11. String&ens
- class Order&en
- Which statement
- 如何将字符串转换为数值?()
- Click the
- Given the command l
- 对象间有哪三种关系?对象“班级”与对象“
- Given: 3.class&ensp
- 编写一个程序,能够从键盘上接收两个数字,
- 1. class
- 有一个n*m的矩阵,编写程序,找出其中最
- 现有: int