题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-05-11 02:34:09

[填空题]将下面Applet程序补充完整。
import java.awt.*:
import java.apptet.*;
public class Hi ______
 public void paint(Graghics g)
   g.drawstring("Hi!",2.5,2.5);
 

更多"将下面Applet程序补充完整。 import java.awt.*"的相关试题:

[填空题]将下面Applet程序补充完整。 import java.awt.*: import java.apptet.*; public class Hi ______ {  public void paint(Graghics g) {    g.drawstring("Hi!",2.5,2.5);  } }
[填空题]将下面Applet程序补充完整。
import java.awt.*:
import java.apptet.*;
public class Hi ______
 public void paint(Graghics g)
   g.drawstring("Hi!",2.5,2.5);
 

[填空题]将下列的程序补充完整。
import java.applet.Applet;
import java.awt.Graphics;
public class Applet2 extends Applet

public void print(Graphics gap)

int i=678;
gap.drawstring(Integer. ______ (i),20,60);


[填空题]将下列的程序补充完整。     import java.applet.Applet;     import java.awt.Graphics;     public class Applet2 extends Applet     {         public void paint(Graphics gap) {         in i=678;       gap.drawstring(Integer.【 】 (i),20,60);     }    }
[填空题]将下面程序补充完整。
public class PowerCale
 public static void main(String[] args)
  double x=5.0;
  System.out.println(x+"to the power 4 is"+power(x,4));
  System.out.println("7.5 to the power 5 is"+power(7.5,5));
  System.out.println("7.5 to the power 0 is"+power(7.5,0));
  System.out.println("10 to the power -2 is"+power(10,-2));
 
 static double ______ (double x,int n)
  if(n>1)return x * power(x,n-1);
  else if(n<0)return 1.0/power(x,-n);
  else return n==0 1.0:x:
  

[填空题]将下面程序补充完整。 public class PowerCale {  public static void main(String[] args) {   double x=5.0;   System.out.println(x+"to the power 4 is"+power(x,4));   System.out.println("7.5 to the power 5 is"+power(7.5,5));   System.out.println("7.5 to the power 0 is"+power(7.5,0));   System.out.println("10 to the power -2 is"+power(10,-2));  }  static double ______ (double x,int n) {   if(n>1)return x * power(x,n-1);   else if(n<0)return 1.0/power(x,-n);   else return n==0 1.0:x:   } }
[填空题]将下面程序补充完整。 #include <iostream> using namespace std; class Base{ public: 【14】 fun( ){return 0;} //声明虚函数 }; class Derived:public Base{ public: x,y; void SetVal(int a,int b){} int fun( ){return x+y;} }; void 【15】 SetVal(int a,int b){x=a;y=b;} //类Derived成员函数 void main( ){ Derived d; cout<<d.fun( )<<endl; }
[填空题]将下面程序补充完整。
#include <iostream>
using namespace std;
class Base
public:
【14】 fun( )return 0; //声明虚函数

class Derived:public Base
public:
x,y;
void SetVal(int a,int b)
int fun( )return x+y;

void 【15】 SetVal(int a,int b)x=a;y=b; //类Derived成员函数
void main( )
Derived d;
cout<<d.fun( )<<endl;

[填空题]下列Applet程序中,指定s为字符串类型,将s绘制在屏幕上,请将程序补充完整。 import java.applet.Applet; import java.awt.Craphics; public class testl8_1 extends Applet { ______String s; public void init ( ) { s=new String("Hello World"); } public Void______(Graphics g) { g.______(s,10,25); } }
[单项选择]描述以下的applet: import java.applet.Applet; import java.awt.event.*; import java.awt.*; public class MyApplet extends Applet { Button b1, b2; public void init( ) { ActionListener a = new ActionListener( ) { public void actionPerformed(ActionEvent evt) { if(evt.getSource( ) == bl) { b1.setEnabled(false); b2.setEnabled(true); } else { b1.setEnabled(true); b2.setEnabled(false); } } } b1 = new Button("1"); b1.addActionListener(a); add(b1); b2 = new Button("2"); b2.addActionListener(a); add(b2); } } 选择所有正确的答案______。
A. applet上只有一个按钮,但它什么都不做
B. applet上什么也没有
C. applet上有两个按钮,当用户单击一个按钮时,它将成为disabled:当用户单击另一个按钮时,另一个将成为enabled
D. 当用户单击按钮时,什么都不会发生
[填空题]请将下面的程序补充完整,使得程序输出“飘是张娜的书”。
#include<iostream>
using namespace std
claSS Book
public:
Book(char*str)| strcpy(title,str);
void Printlnfo( )cout<<title<<end1;
protected:
char title[50];

class MyBook:public Book
public:
MyBook(char*s1,char*s2="张娜");
______(strcpy(owner,s2);
virtual void Printlnfo( )cout<<title<<"是"<<owner<<"的书"<<end1;
private:
char owner[10];

int main( )
Book *ptr=new MyBook("飘");
ptr—>PrintInfo( );
return 0;

[单项选择]阅读下面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( )
  ______
 

程序中下画线处应填入的正确选项是
A. Container contentPane=getContentPane();contentPane.add(1);
B. Jpanel contentPane=new JPanel();contentPane.add(1);
C. contentPane.add(1);
D. add(1);

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码