You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB
Plaintext

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Java类Demo中存在方法func1、func2、func3和func4请问该方法中哪些是不合法的定义( )
public class Demo{
  float func1()
  {
    int i=1;
    return;
  }
  float func2()
  {
    short i=2;
    return i;
  }
  float func3()
  {
    long i=3;
    return i;
  }
  float func4()
  {
    double i=4;
    return i;
  }
}
Afunc1
Bfunc2
Cfunc3
Dfunc4
以下说法中正确的有
AStringBuilder是 线程不安全的
BJava类可以同时用 abstract和final声明
CHashMap中使用 get(key)==null可以 判断这个Hasmap是否包含这个key
Dvolatile关键字不保证对变量操作的原子性
下列说法正确的是
A在类方法中可用this来调用本类的类方法
B在类方法中调用本类的类方法可直接调用
C在类方法中只能调用本类的类方法
D在类方法中绝对不能调用实例方法
list是一个ArrayList的对象哪个选项的代码填到//todo delete处可以在Iterator遍历的过程中正确并安全的删除一个list中保存的对象
Iterator it = list.iterator();
int index = 0;
while (it.hasNext())
{
Object obj = it.next();
if (needDelete(obj)) //needDelete返回boolean决定是否要删除
{
//todo delete
}
index ++;
}
Ait.remove();
Blist.remove(obj);
Clist.remove(index);
Dlist.remove(obj,index);