摘要:
} public class Test { private static int n = 0; public Test() { n++; } public static int getNum() { return n; } public static void main(String[] args) 阅读全文
摘要:
public class Me { int x=1; static int y=2; public static void method()//静态方法 { System.out.println("实例变量x = " + new Test().x);//在静态方法中访问类的实例变量需首先进行类的实例 阅读全文
摘要:
package we; public class MethodOverload { public static void main(String[] args) { System.out.println("The square of integer 7 is " + square(7)); Syst 阅读全文
摘要:
写一个函数,在函数中运用递归,递归停止的条件是当输入的字符串用charArt()函数倒读读到第一个字符时停止递归,递归的作用是比较正序和倒序的相对应字符, 最后若正倒序相同则回文,不同则不回文。 package pp; import java.util.Scanner; public class w 阅读全文
摘要:
package we; import javax.swing.JOptionPane; public class we { public static void main(String args[]){ int m=1; for(m=1;m<2;) { m=2; String sr; String 阅读全文