大转盘java源代码 h5大转盘源码

java新手,求完整的源代码//都是从新手过来的,以下代码供参考
//1.
public class BankAccount {
private static String acctnum;
private static double money;
private static void showAcct() {
System.out.println("账号为: " + acctnum);
}
private static void showMoney() {
System.out.println("余额为: " + money);
}
public BankAccount(String acc, double m) {
this.acctnum = acc;
this.money = m;
}
public static void main(String[] args) {
BankAccount ba = new BankAccount("626600018888", 5000.00);
ba.showAcct();
ba.showMoney();
【大转盘java源代码 h5大转盘源码】 }
}
//2.
public class Triangle {
private static float a;
private static float b;
private static float c;
public Triangle(float a, float b, float c) {
this.a = a;
this.b = b;
this.c = c;
}
public static boolean judgeTriangle(float a, float b, float c) {
if ((aMath.abs(b - c)ab + c)
(bMath.abs(a - c)ba + c)
(cMath.abs(a - b)ca + b))
return true;
else
return false;
}
public float getCircumference() {
return this.a + this.b + this.c;
}
}
//3.
public class TestTriangle {
public static void main(String[] args) {
Triangle t = new Triangle(5.3f,7.8f,9.3f);
if(t.judgeTriangle(5.3f,7.8f,9.3f)){
System.out.print("能够成三角形,周长为: ");
System.out.printf("%9.2f",t.getCircumference());}
else
System.out.println("不能构成三角形");
}
}
java:哪里能看到JDK的源代码?你安装JDK的目录下,有个src.zip文件,这个就是JDK源代码的java文件 。
你可以解压来查看,但,最好是关联到IDE如 eclipse 中(不需解压) , 然后 CTRL + 点击就可以查看到源代码了 。
如下图:
求编写一个超级简单的Java的程序源代码import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class ConstructFrame extends JFrame
{
private static final long serialVersionUID = 1L;
String value1="",result,value2="";
int flag=0,fix=0,sum=1;
Booleanhappy;
JTextField text=new JTextField(30);
int flagsum=0;
Container c=getContentPane();
JButton buttonx;
ConstructFrame()
{super("计算器");
c.setLayout(null);
c.setBackground(Color.blue);
this.setSize(400, 400);
c.add(text);
text.setHorizontalAlignment(JTextField.RIGHT);
final JButton buttonx=new JButton("BackSpace");
c.add(buttonx);
buttonx.addMouseListener(new MouseAdapter()
{
public void mousePressed(MouseEvent e)
{
int count=0;
String temp;
if(flag==0)
{
count=value1.length();
if(count!=1)
temp=value1.substring(0, count-1);
else
temp="0";
value1=temp;
}
else
{
count=value2.length();
if(count!=1)
temp=value2.substring(0, count-1);
else
temp="0";
value2=temp;
}
text.setText(temp);
}
});
final JButton buttony=new JButton("CE");
c.add(buttony);
buttony.addMouseListener(new MouseAdapter()
{
public void mousePressed(MouseEvent e)
{
value1="";
value2="";
flag=0;
text.setText("0");
}
});
final JButton button1=new JButton("1");
c.add(button1);
button1.addMouseListener(new MouseAdapter()
{
public void mousePressed(MouseEvent e)
{
String temp;
if(flag==0)
{
value1=value1+1;
temp=value1;
}
else
{
value2=value2+1;
temp=value2;
}
text.setText(temp);
}
});
final JButton button2=new JButton(" 2 ");

推荐阅读