yhkn.net
当前位置:首页 >> jAvA新手代码大全 >>

jAvA新手代码大全

1前进一步 2后退一步 3不动 4前进一步 5后退一步 6不动 7前进一步 8后退一步 9不动 10前进一步 11后退一步 12不动 13前进一步 14后退一步 15不动 16前进一步 17后退一步 18不动 19前进一步 20后退一步 21不动 22前进一步 23后退一步 24不

//都是从新手过来的,以下代码供参考//1.public class BankAccount { private static String acctnum; private static double money; private static void showAcct() { System.out.println("账号为: " + acctnum); } private static void showMoney() {

public class aa{ public static void main(String [] args){ int a=0;//定义一个计数器 for(int i=1;ia=a+i;//加总和 } System.out.println(a);//打印出总和 } } 答案5050

这也太多了吧,一时半会还真写不完.建议买本书看看吧,或者找个项目看看.

public class TestMethod{ public static void main (String[] args){ m(); m2(5); m3(3,4); m3(4,6); int i = m3(3,5); System.out.println(i); } public static void m(){ System.out.println("ok"); System.out.println("hello"); } public static void m2(int i){ if(i > 3)

public class MyPoint { private int x,y; public void setX(int x){ this.x=x; } public int getX(){ return x; } public void setY(int y){ this.y=y; } public int getY(){ return y; } public double toString1(int x,int y){ return x/y; } public static void main(String[] args){ MyPoint

class Square { int length; Square(int len) { length = len; } void getPerimeter() { System.out.println("正方形的周长为" + (4 * length)); } } class Rectangle extends Square { int width; Rectangle(int len, int wid) { super(len); width = wid; } void

//java计算器===========import java.awt.*;import java.awt.event.*;import java.text.DecimalFormat;import java.util.Dictionary;import javax.swing.*;public class Calculator extends JFrame { private JTextField jtf; private JPanel panel1, panel2, panel3,

网上搜索下一大把.最好找本基础书籍,对着敲 再看看别人怎么说的.

package cn.shijie.test; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class test1 { static mproduct m1 = new mproduct(); static mproduct m2 = new mproduct(); static mproduct m3 = new mproduct(); public static void

sbsy.net | ceqiong.net | tuchengsm.com | dfkt.net | sgdd.net | 网站首页 | 网站地图
All rights reserved Powered by www.yhkn.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com