谁可以帮我找两个自编的JAVA的基本程序?????

来源:百度知道 编辑:UC知道 时间:2024/05/17 02:25:31
简单一点的,不要太复杂

1.class book
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}

2.
class suzu
{
public static void main(String[] args)
{
int a[],i;
a=new int[3];
for(i=0;i<=a.length;i++)
{a[i]=1+i;
System.out.println(a[i]+" ");
}
}
}

1.
import java.awt.*;
import javax.swing.*;

//Class J_ButtonLay: To present 3 lines of buttons
public class J_ButtonLay extends JFrame
{
// Construction of class: J_ButtonLay
public J_ButtonLay()
{
super("Buttons in 3 Lines");

int arr[] = {3, 1, 2};
JButton[][] inLine = new JButton[3][];
JPanel[] panel = new JPanel[3];
Container cont = getContentPane();
cont.setLayout(new BoxLayout(cont, BoxLayout.Y_AXIS));

for(int i = 0; i < 3; i++) {
inLine[i