首页/ 题库 / [单选题]

下面可作为public void 的答案

下面可作为public void aMethod(){...}重载方法的是(  )。

单选题
2023-04-27 12:25
A、void aMethod(){...}
B、public int aMethod(){...}
C、public void aMethod ( ){...}
D、public int aMethod(int m){...}
查看答案

正确答案
D

试题解析

标签: Java程序设计
感兴趣题目
下面程序的输出结果是( )。 import java.awt.*; import java.applet.*; public class HelloApplet extends Applet { public void paint(Graphics g) { g.drawstring("Hello World!", 20, 20); } }
下面程序的输出结果是( )。 import java. awt.*; import java. applet.*; public class HelloApplet extends Applet { public void paint(Graphics g) { g.drawString("Hello World! ",20,20); } }
有如下程序: class Base1 { public: int a; void b() { return}; void c(float) { a=float;} }; class Base2 { public: void b(){} void c(){} private: int a; }; class Derived:public Basel,public Base2 { public: void b(){} }; void main() { Derived obj; obj.a=1; //① obj.b(); //② obj.c(10); //③ } 下面各项对语句①②③的描述中,正确的是( )。
阅读下面程序 public class MyVal { public static void main(String[]args) { MyVal m=new MyVal(); m.amethod(); } public void amethod() { boolean b[]=new Boolean[5]; } } 程序编译或运行的结果是
给定java代码如下所示,在A处新增下列()方法,是对cal方法的重载。public class Test {  public void cal(int x, int y, int z) { } //A } 
public class Team extends java.util.LinkedList {  public void addPlayer(Player p) {  add(p);  }  public void compete(Team opponent) { /* more code here */ }  }  class Player { /* more code here */ }  Which two are true?()
阅读下面程序 class Test implements Runnable { public static void main(String[] args) { Test t=new Test(); t.start(): } public void run() {} } 下列关于上述程序的叙述正确的是
阅读下面程序 public class Test implements Runnable { public static void main(String[] args) { ______ t.start(); } public void run() { System.out.println("Hello!"); } } 程序中下画线处应填入的正确选项是
阅读下面Applet程序 import javax.swing.*: import java.awt.*: public Class Test SwingApplet extends JApplet { JLabel 1=new JLabel("This is a Swing Applet."); public void init() { ______ } } 程序中下画线处应填入的正确选项是

下面可作为public void aMethod(){...}重载方法的是(  )。

下面(  )命令可用于编译Java程序。

下面程序的结果是 ______。 #include<iostream.h> class A{ public: virtual void fun()=0{}; }; class B:public A{ public: void fun () {cout<< "new file" ;} }; class C: public A{ public: void fun (){cout<<"open file"<< " " } }; class D: public A{ public: void fun () {cout<< "save file " ;} }; void main() { A a,*p; B b; C c; D d; p=&c; p->fun (); p=&b; p->fun (); p=&d; p->fun(); }
相关题目
运行下列程序的结果是( ) abstract class MineBase{ abstract void amethod(); static int i; } public class Mine extends MineBase {
下面哪个方法是 public void example(){...} 的重载方法?
指出下列哪个方法与方法public void add(int a){}为错误的重载方法()
有如下程序: class Base1 { public: int a; void b() { return}; void c(float) { a=float;} }; class Base2 { public: void b(){} void c(){} private: int a; }; class Derived:public Basel,public Base2 { public: void b(){} }; void main() { Derived obj; obj.a=1; //① obj.b(); //② obj.c(10); //③ } 下面各项对语句①②③的描述中,正确的是( )。
下面程序的结果是 ______。 #include<iostream.h> class A{ public: virtual void fun()=0{}; }; class B:public A{ public: void fun () {cout<< "new file" ;} }; class C: public A{ public: void fun (){cout<<"open file"<< " " } }; class D: public A{ public: void fun () {cout<< "save file " ;} }; void main() { A a,*p; B b; C c; D d; p=&c; p->fun (); p=&b; p->fun (); p=&d; p->fun(); }
下面程序的运算结果是( )。 #include<iostream> using namespace std; class A { public: virtual void fun()=0; }; class B:public A } public: void fun() {cout<<"new file"<<" ";} }; class C:public A { public: void fun() { cout<<"open file"<<" ";} }; void main() { A a, * p; B b;C c; p=&c; p->fun(); p=&b; }
下列程序实现了2个监听器接口:ActionListener和W1ndowListener。 import java.awt.*; import java.awt.event.*; public class ex39______ { public static void main(String[] args) { ex39 bj = new ex39(); obj .go(); } public void go() { Frame. f = new Frame("ex39"); f.addWindowListener(this); Button b = new Button("Button"); b.addActionListener(this); f.add(b); f.pack(); f.setVisible(true); } public void actionPerformed(ActionEvent e) { System.out.println("Button pressed!"); } public void windowActivated(WindowEvent e){} public void windowDeactivated(WindowEvent e){} public void windowClosed(WindowEvent e) {} public void windowClosing(WindowEvent e){System.exit(1); public void windowIconified(WindowEvent e){} public void windowDeiconified(WindowEvent e) {} public void windowOpened(WindowEvent e){} } 请选择正确的语句填入横线处。
下面选项中是public void example(){...}的重载函数的有()。
下面哪几个函数是public void example(){...}的重载函数()。
阅读下面程序 public class MyVal { public static void main(String[]args) { MyVal m=new MyVal(); m.amethod(); } public void amethod() { boolean b[]=new Boolean[5]; } } 程序编译或运行的结果是
阅读下面程序 public class Test implements Runnable { public static void main(String[] args) { ______ t.start(); } public void run() { System.out.println("Hello!"); } } 程序中下画线处应填入的正确选项是
阅读下面程序 public class My Val{ public static void main(String args[]){ My Val m=new My Val(); m. amethod(); } public void amethod(){ boolean b[]=new Boolean[5]; } } 程序编译或运行结果是
下面程序的运算结果是( )。 #include<iostream> using namespace std; class A { public: virtual void fun()=0; }; class B:public A } public: void fun() {cout<<"new file"<<" ";} }; class C:public A { public: void fun() { cout<<"open file"<<" ";} }; void main() { A a, * p; B b;C c; p=&c; p->fun(); p=&b; }
下面哪个函数是public void  aMethod(){...}的重载函数?( D )
Test.java程序代码如下: public class Test{ public static void main(String[] args){ System.out.println(args[1]); } } 以上程序编译后用java Test 2 3 4 5运行的输出结果是什么? ( )
下面选项中是public void example(){...}的重载函数的有()。
下面哪几个函数是public void example(){...}的重载函数()。
阅读下面程序 public class My Val{ public static void main(String args[]){ My Val m=new My Val(); m. amethod(); } public void amethod(){ boolean b[]=new Boolean[5]; } } 程序编译或运行结果是
阅读下面程序 public class Cycle { public static void main(String[] args) { System.out.println(args[0]); } } 在命令行输入java Cycle one two,该程序输出的结果是
阅读下面程序 pubic class Cycle{ public static void main(String args[]){ System. out. println(args[0]); 在命令行中输入java Cycle one two,该程序输出结果是
广告位招租WX:84302438

免费的网站请分享给朋友吧