阅读下面代码:import java.awt.*;public class Exam11_1{private Frame. f;private Button b1,b2,b3,b4;public static void main(String args[]{Exam11_1 that = new Exam11 1 ();that.go();}public void go(){______;f.setLayout(new FlowLayout()) ;;b1 = new Button ("Button 1");b2 = new Button ("Button 2");b3 = new Button ("Button 3");b4 = new Button ("Button 4");f.add (b1);f.add (b2);f.add (b3);f.add (b4);f.pack ();f.setVisible (true);}}请在程序中画线处填写正确的语句【 】,以便编译运行程序后得到正确的结果。

阅读下面代码:

import java.awt.*;

public class Exam11_1

{

private Frame. f;

private Button b1,b2,b3,b4;

public static void main(String args[]

{

Exam11_1 that = new Exam11 1 ();

that.go();

}

public void go()

{

______;

f.setLayout(new FlowLayout()) ;;

b1 = new Button ("Button 1");

b2 = new Button ("Button 2");

b3 = new Button ("Button 3");

b4 = new Button ("Button 4");

f.add (b1);

f.add (b2);

f.add (b3);

f.add (b4);

f.pack ();

f.setVisible (true);

}

}

请在程序中画线处填写正确的语句【 】,以便编译运行程序后得到正确的结果。


相关考题:

A VPN is physically () but virtually () A、none of the aboveB、public; hybridC、private; publicD、public; private

请在mian函数中填空使下面程序的输出结果为1 1。 include class A { private: 请在mian函数中填空使下面程序的输出结果为1 1。include<iostream.h>class A{ private:int a;int b;public:A( ):a(0) ,b(1) { }void show( ) { cout < < a < < " " < < b;} };class B{ private:int a;int c;public:B( ):a(1),

有如下程序:includeusing namespqce Std;class TestClass{private;Char C;public;Tes 有如下程序: #include<iostream> using namespqce Std; class TestClass { private; Char C; public; TestClass(char n):c(n){} ~TestClass() { cout<<c; }; class TestClassl:public TestClass { private: Char C; public:A.xyB.yxC.xD.y

下面这个程序的结果是includeclass A{private:int a;public:void seta();int geta( 下面这个程序的结果是 #include<iostream.h> class A { private: int a; public: void seta();int geta();}; void A∷seta() {a=1;} int A∷geta() {return a;} class B { pnvate: int a; publiC: void sera();int geta();}; void B∷seta() {a = 2;} int B∷geta() {return a;} class C:public A,public B { private: int b; public: void display();}; void C∷display() { int b=geta(); cout<<b;} void main() { C c; c.seta(); c.display();}A.1B.2C.随机输出1或2D.程序有错

下面这个程序的结果是 include class A { private: int a; public: void seta( ) ; 下面这个程序的结果是#include<iostream.h>class A{private:int a;public:void seta( ) ;int geta( ) ;};void A: :seta( ){ a=1;}int A: :geta( ){ retum a;}class B{ private:int a;public:void seta( ) ;int geta( ) ;};void B: :seta( ){a=2;}int B: :geta( ){return a;}class C: public A,public B{ private:int b;public:void display( ) ;};void C: :display( ){ int b=geta( ) ;cout < < b;}void main( ){ C c;c. seta( ) ;c. display( ) ;}A.1B.2C.随机输出1或2D.程序有错

下面程序的结果为includeint c;class A{private:int a;static int b;public:A( ){a 下面程序的结果为 #include<iostream.h> int c; class A { private: int a; static int b; public: A( ) {a=0;c=0;} void seta( ){a++;} void setb( ){b++;}A.1 2 1B.1 2 2C.1 1 2D.2 2 2

阅读下面程序:include template class TAdd{private:T x, y;public:TAdd(T 阅读下面程序:include <iostream.h>template <class T>class TAdd{private:T x, y;public:TAdd(T a, T b){x=a;y=b;}T add(){return x +y;}};void main( ){TAdd<int>a(5,6);TAdd<double>b(2.4,5.8);cout<<"s1 ="<<A. add()<<",";cout<<"s2="<<B, add()<<end1;}写出该程序的运行结果:【 】。

访问修饰符作用范围由大到小是( )A)private-default-protected-publicB)public-default-protected-privateC)private-protected-default-publicD)public-protected-default-private

判断下面程序编译是否正确,如果错误简要说明原因 class B{ public: B(int a){ x=a; } private: int x; }; class D : public B{ public: D(int a ) : y(a){ } private: int y; };

访问修饰符作用范围由大到小是A.private-default-protected-publicB.public-default-protected-privateC.private-protected-default-publicD.public-protected-default-private