首页/ 题库 / [单选题]以public修饰的类如:public 的答案

以public修饰的类如:public class Car{…} 则Car()

单选题
2022-02-23 12:09
A、可被其它程序包中的类使用
B、仅能被本程序包中的类使用
C、不能被任意其它类使用
D、不能被其它类继承
查看答案

正确答案
A

试题解析

感兴趣题目
下列代码的下画线处应填入的方法名是( )。 import java.awt.*; import java.applet.*; public class Hello extends Applet{ public void (Graphics g){ 9.drawstring("How are you!",l0,10); } }
关于下面的程序段,说法正确的是( )。 import java.awt.*; import java.applet.*; public class Test extends Applet { Canvas MyCanvas; public void init() { MyCanvas=new Canvas() MyCanvas.seBackSround(Color.cyan); add(MyCanvas); } }
关于下面的程序段,说法正确的是 import java.awt.*; import java.applet.*; public class Test extends Applet{ Canvas MyCanvas; public void init(){ MyCanvas=new Canvas(); MyCanvas.setBackground(Color.cyan); add(MyCanvas); } }
如果创建的子类覆盖了父类的一个public方法,则对该方法可以使用( )修饰符。
class java {  public static void main(String [] java) {   for (int Java = 1; Java 〈 java.length; Java++)   System.out.print("java ");   }   }   和命令行:  java java java java java   结果为:()  
Periodic publications notifying changes in,or additions to,previously published navigational data are().
在一个合法的Java源程序文件中定义了3个类,其中属性为public的类可能有( )个。
在一个合法的Java源程序文件中定义了3个类,其中属性为public的类可能有()个。
You are developing a Windows Communication Foundation (WCF) service that contains the following service contract.[ServiceContract( )]public interface IPaymentService{ [OperationContract( )] void RecordPayments(Person person);}public class Person{ ... }public class Employee : Person{ ... }public class Customer : Person{ ... }You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. What should you do?()
怎样区分应用程序和小应用程序?应用程序的主类和小应用程序的主类必须用public修饰吗?
Periodic publications notifying changes in,or additions to,previously published navigational data are().

某java程序的类定义如下: public class MyClass extends BaseClass{   }则该java源文件在存盘时的源文件名应为如下哪一种:(  )。

相关题目
在一个合法的Java源程序文件中定义了3个类,其中属性为public的类可能有( )个。

It's ___________ to point to or talk about strangers in public.

接口中的所有成员方法都默认具有public和abstract修饰。

下列程序实现了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){} } 请选择正确的语句填入横线处。
下面程序的结果是 #include<iostream.h> class A { public: A(){cout<<"construtA" <<endl;} virtual ~A() {cout << "destructA" <<endl;}}; class B:public A { }; class C:public A { }; class D:public B,public C { }; void main() { Dd;}
若有以下程序: #inclide<iostream> using nameSpace std; class A { pricate: int a; public: A(int i) { a=i } Void disp() { cout<<a<<","; } }; clas B { private: int b; public: B(int j) { b=j; } Void disp() { cout<<b<<","; } }; class C:publicB,public A { private: int c; public: C(int k):A(k-2),B(k+2) { c=k; } void disp() { A::disp(); B::disp(); cout<<c<<endl; } }; int main() { C obj(10); obj.disp(); return 0; } 程序执行后的输出结果是
用public修饰的类称为( )
Criminals are given the _____ of going to jail or facing public humiliation.
Test.java程序代码如下: public class Test{ public static void main(String[] args){ System.out.println(args[1]); } } 以上程序编译后用java Test 2 3 4 5运行的输出结果是什么? ( )
It.s __________ to point to or talk about strangers in public.
若有以下程序: #include <iostream> using namespace std; class A { protected: int a; public: A() { a=10; } }; class A1 : public A { public: A1() { a=a+1; } }; class A2 : public A { public: A2 () { a=a+2; } }; class B : public A1,public A2 { public: B(){} void print() { cout<<a<<end1; } }; int main ( ) { B obj; obj.print(); return 0; } 程序运行后的输出结果是( )。
下面程序的结果是 #include<iostream.h> class A { public: A(){cout<<"construtA" <<endl;} virtual ~A() {cout << "destructA" <<endl;}}; class B:public A { }; class C:public A { }; class D:public B,public C { }; void main() { Dd;}
简述private、protected、public、internal修饰符的访问权限。
阅读下面程序 public class Cycle { public static void main(String[] args) { System.out.println(args[0]); } } 在命令行输入java Cycle one two,该程序输出的结果是
下面程序的输出结果是( )。 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); } }
有如下程序: #include <iostream.h> class x { protected: int a; public: x() { a=1; } }; class x1 : virtual public x { public: x1() { a+=1; cout<<a; } }; class x2 : virtual public x { public: x2() { a+=2; cout<<a; } }; class y : public xl,public x2 { public: y() { cout<<a<<end1; } }; int main() { y obj; return O; } 该程序运行后的输出结果是( )。
若有以下程序: #include<iostream> using namespace Std; Class Base {public: Base() {x=0;} int x;}; class Derivedl:virtua1 public Base {public: Derived1() {x=10;}}; class Derived2:virtual1 public Base {public: Derived2()
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?()
以public修饰的类如:public class Car{…} 则Car()
广告位招租WX:84302438

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