云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > JAVA期末试题及答案

JAVA期末试题及答案

  • 62 次阅读
  • 3 次下载
  • 2025/6/4 13:53:38

} }

class Student{

public static void main(String arg[]){ Student A=new Student();

Undergraduate B=new Undergraduate(); B.setName(\许翼\ B.setScore(95);

B.setDeparment(\信息工程系\ B.setMajor(\计算机网络\ B.show1(); } }

2.从键盘或者命令行输入3个数,求这三个数的最大值。 2. import javax.swing.JOptionPane; public class MaxNum {

public static String sum(int a,int b,int c,int d){ if(a>b){ d=a; } if(b>d){ d=b; } if(c>d){ d=c; }

return \你输入的三个数字中,最大的数是\ }

public static void main(String[] args) { int number1,number2,number3; try{

number1=Integer.parseInt(JOptionPane.showInputDialog(\ number2=Integer.parseInt(JOptionPane.showInputDialog(\ number3=Integer.parseInt(JOptionPane.showInputDialog(\ System.out.println(sum(number1,number2,number3,0)); }catch(NumberFormatException ne){

System.out.println(ne.toString()); }

System.exit(0); }

the first Number: \the second Number: \the third Number: \ }

3. import java.awt.*;

public class TestCenterPanel {

public static void main(String args[]) { new MyFrame3(300,300,600,400,Color.BLUE); } }

class MyFrame3 extends Frame{ //private Panel p;

MyFrame3(int x,int y,int w,int h,Color c){ super(\ setLayout(null); setBounds(x,y,w,h); setBackground(c);

Panel p = new Panel(null); p.setBounds(w/4,h/4,w/2,h/2); p.setBackground(Color.pink); add(p);

setVisible(true); } }

搜索更多关于: JAVA期末试题及答案 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

} } class Student{ public static void main(String arg[]){ Student A=new Student(); Undergraduate B=new Undergraduate(); B.setName(\许翼\ B.setScore(95); B.setDeparment(\信息工程系\ B.setMajor(\计算机网络\ B.show1(); } } 2.从键盘或者命令行输入3个数,求这三个数的最大值。 2. import javax.swing.JOptionPane; public class MaxNum {

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com