请判断下列写法中那种写法正确?
A: public void btnClick(view v)
B: public void btnClick()
C: private void btnClick(view v)
A: public void btnClick(view v)
B: public void btnClick()
C: private void btnClick(view v)
举一反三
- 运行JAVA程序的入口函数main的正确写法是? A: public void main(){} B: public static void main() {} C: public static void main(String[] args) {} D: public void main(String[] args) {}
- 中国大学MOOC: 以下Pair泛型类public class Pair<K, V> { public Pair(K key, V value) { this.key = key; this.value = value; } public K getKey(); { return key; } public V getValue(); { return value; } public void setKey(K key) { this.key = key; } public void setValue(V value) { this.value = value; } private K key; private V value;}经过类型擦除后,变成以下类public class Pair { public Pair(Object key, Object value) { this.key = key; this.value = value; } public Object getKey() { return key; } public Object getValue() { return value; } public void setKey(Object key) { this.key = key; } public void setValue(Object value) { this.value = value; } private Object key; private Object value;}
- main()的写法是public void main(String[]arg)
- 可以从该类的外部访问的方法是() A: public void getValue() B: private void getValue() C: void public getValue() D: void private getValue()
- 请选择JAVA的入口方法: A: public void main() B: public static void main() C: public static void entry() D: public static void main(String[] args)