更多"下列Java语句从指定网址读取html文件,在下画线处应填上的选项是_"的相关试题:
[填空题]请在代码中的画线处填写正确的语句 【16】 ,使程序输出hello world!。
//HelloApplet.java
Import java.awt.*;
Import java.applet.*;
Public class HelloApplet extends
{
Public void paint(Graphics g)
{
_______ ("hello world! ",20,20);
}
}
[填空题]请在代码中的画线处填写正确的语句 【16】 ,使程序输出hello world!。
//HelloApplet.java
Import java.awt.*;
Import java.applet.*;
Public class HelloApplet extends
Public void paint(Graphics g)
______ ("hello world!",20,20);
[单项选择]下列程序中画线处应填入的语句是
classBase
public:
voidfun( )COUt<<"Baseoffun"<<endl;
;
classDerived:publicBase
voidfun( )
_______//显示基类的成员函数fun
cout<<"Derivedoffun"<<endl;
;
A. fun( );
B. Base.fun( );
C. Base::fun( );
D. Base->fun( );
[单项选择]下列程序中画线处应填入的语句是
class Base
public:
void fun( )cout<<"Base of fun"<<end1;
;
class Derived:public Base
void fun( )
______//显示基类的成员函数fun
cout<<"Derived of fun"<<end1;
;
A. fun( );
B. Base.fun( );
C. Base: :fun( );
D. Base->fun( );
[单项选择]下列程序中下画线处应填入的语句是
class Base
{
public:
void fun( ) {cout < < "Baseoffun" < < endl;}
};
class Derived:public Base
{
void fun( )
{
______//显示基类的成员函数fun
cout < < "Derived of fun" < < endl;
}
};
A) fun( ) ; B) Base. fun( ) ;
C) Base: :fun( ) ; D) Base->fun( ) ;
[单项选择]下列程序中下画线处应填入的语句是
class Base
public:
void fun( ) cout < < "Baseoffun" < < endl;
;
class Derived:public Base
void fun( )
______//显示基类的成员函数fun
cout < < "Derived of fun" < < endl;
;
A) fun( ) ; B) Base. fun( ) ;
C) Base: :fun( ) ; D) Base->fun( ) ;
[单项选择]应在下列程序画线处填入的正确语句是 ( )。 #include <iostream> using namespace std; clas Base { public: void fun( ) { cout<<"Base::fun"<<end1; } }; class Derived : public Base { void fun( ) { ________________//显示调用基类的函数 fun( ) cout<<"Derived::fun"<<end1; } };
A. fun();
B. Basfun();
C. Base::fun();
D. Base->fun();
[填空题]在下列程序的下画线处,填入适当语句使程序能正确执行并输出异常栈信息。
Public class ThrowableException
Public static void main (String args[])
try
throw new Throwable("这里是本人定义的异常");
catch(Throwable e)
System.out.printIn("Caught Throwable");
System.out.printIn("e.getMessage( ):"+e.getMessage( ));
System.out .printIn("e.toString( ):"+e.toString( ));
System.out.printin("e.printStackTrace( ):");
______;)
[单项选择]为了支持压栈线程与弹栈线程之间的交互与同步,在下画线处依次填入的语句是
public class IntStack
private int idx=0;
private int[]data=new int[8];
public ______ void push(int i)
data[idx]=i;
idx++;
______
…
A. synchronized() notify()
B. synchronized() this.wait()
C. synchronized() this.notify()
D. synchronized() sleep()
[填空题]bar为一JSerollBar组件,阅读下面程序段,请在程序中的画线处填入正确的语句使程序能够正确运行。
…
public WellAdjusted( )
super("Well Adjusted");
setSize(350,100);
bar.addAdjustmentListener(this);
value.setHorizontalAlignment(SwingConstants.CENTER);
value.setEditable(false);
JPanel pane=new JPane( );
pane.setLayout(new BorderLayout( ));
pane.add(value,"Center"):
pane.add(bar,"South");
setContentPane(pane);
public void adjustmentValueChanged(AdjustmentEvent evt)
【12】
if(source==bar)
int newValue bar.getValue( );
value.setText(""+newValue);
repaint( );
…
[单项选择]为使程序的输出结果为: Base:: fun 那么应在下列程序画线处填入的正确语句是( )。 #include <iostream> using namespace std; class Base { public: void fun ( ) { cout<<"Base: :fun"<<end1; } }; class Derived : public Base { public: void fun ( ) { cout<<"Derived: :fun"<<end1; } }; int main ( ) { Base a,*pb; Derived b; _________; pb->fun( ); //调用基类的成员函数 fun( ) return 0 ; }
A. pb=&a
B. pb=b
C. pb=&b
D. pb=&Base
[填空题]bar为一JScrollBar组件,阅读下面程序段,请在程序中的画线处填入正确的语句使程序能够正确运行。
...
public WellAdjusted( )
super("Well Adjusted");
setSize(350,100);
bar.addAdjustmentListener(this);
value.setHorizontalAlignment(SwingConstants.CENTER);
value.setEditable(false);
JPanel pane = new JPane( );
pane.setLayout(new BorderLayout( ));
pane.add(value,"Center"):
pane.add(bar,"South");
setContentPane(pane);
public void adjustmentValueChanged(AdjustmentEvent evt)
【12】
if(source ==bar)
int newValue bar.getValue( );
value.setText(""+newValue);
repaint( );