JAVAÆÚÄ©ÊÔÌâ¼°´ð°¸ ÏÂÔØ±¾ÎÄ

} }

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); } }