上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: 1.栈内存保存的是堆内存空间的访问地址。2.一个栈内存空间只能指向一个堆内存空间。3.匿名对象就是已经开辟了的堆内存空间的并可以直接使用的对象。4.字符串的内容不可改变。5.this调用构造方法必须放在构造方法的首行。6.非static声明的方法可以调用static类型的方法,但static类型的不能调用非static类型的方法。7.equals比较的是两个字符串的地址值。8.子类对象实例化之前必须先调用父类中的构造方法。9.接口的实际应用是指定标准,抽象类的实际应用是模板设计。10.Object类是所有对象的父类,可以接收任意的引用数据类型。11.多个线程共享同一资源需同步,但过多的同步会造 阅读全文
posted @ 2012-03-05 20:29 谈笑风生膜法师 阅读(407) 评论(0) 推荐(1)
摘要: View Code 1 abstract class A{ 2 public static final String FLAG="CHINA"; 3 private String name="朱楷二货"; 4 public String getName(){ 5 return name; 6 } 7 public void setName(String name){ 8 this.name=name; 9 }10 public abstract void print();11 }12 class B ex... 阅读全文
posted @ 2012-03-05 20:28 谈笑风生膜法师 阅读(136) 评论(0) 推荐(0)
摘要: View Code 1 class Link{ 2 class Node{//内部类 3 private String data; 4 private Node next; 5 public Node(String data){//构造方法 6 this.data=data; 7 } 8 public void add(Node newNode){ 9 if(this.data==null){10 this.next=newN... 阅读全文
posted @ 2012-03-04 21:23 谈笑风生膜法师 阅读(191) 评论(0) 推荐(0)
摘要: View Code 1 class Address{ 2 private String Country; 3 private String Province; 4 private String City; 5 private String Street; 6 private int Postcode; 7 public Address(String Co,String P,String C,String S,int Po){ 8 this.Country=Co; 9 this.Province=P;10 ... 阅读全文
posted @ 2012-03-04 16:05 谈笑风生膜法师 阅读(184) 评论(0) 推荐(0)
摘要: 1 class Node{//Node类 2 private String data; 3 private Node next; 4 public Node(String data){ 5 this.data=data; 6 } 7 public String getData(){ 8 return this.data; 9 }10 public void set... 阅读全文
posted @ 2012-03-04 14:37 谈笑风生膜法师 阅读(397) 评论(0) 推荐(0)
摘要: 开始学习JAva,以后常来这里逛了,保持写博客的好习惯。。。 阅读全文
posted @ 2012-03-02 21:26 谈笑风生膜法师 阅读(75) 评论(0) 推荐(0)
摘要: 1 #include 2 int main() 3 { 4 int i,j,n,k=0,sum,sn=1,sn1,m; 5 while(scanf("%d",&n)!=EOF) 6 { for(i=1;i<=n;i++) 7 { 8 { 9 printf("%d",sn); 10 sn1=sn; 11 for(j=k+2,m=1;m<=n-i;m++,j++) 12 ... 阅读全文
posted @ 2011-11-24 20:15 谈笑风生膜法师 阅读(279) 评论(0) 推荐(0)
摘要: #include #include void fun(char *p1,char *p2);int main(){ char str1[]="who i am?",str[190]; for(int i=0;i<strlen(str1);i++) fun(&str[i],&str1[i]); puts(str); for(int j=0;j<strlen(str);j++) printf("%c\n",str[j]); return 0;}void fun(char *p1,char *p2){ while((*p1=*p2) 阅读全文
posted @ 2011-11-23 21:12 谈笑风生膜法师 阅读(193) 评论(0) 推荐(0)
摘要: Description已知:Sn= 1+1/2+1/3+…+1/n。显然对于任意一个整数K,当n足够大的时候,Sn大于K。 现给出一个整数K(1 int main() { int k,n,i; while(scanf("%d",&k)!=EOF) { double sn=0.0; for(i=1;;i++) { sn=sn+1.0/i; if(sn>k) { printf("%d\n",i); break; } } } return 0 ; } 阅读全文
posted @ 2011-11-23 19:51 谈笑风生膜法师 阅读(675) 评论(0) 推荐(0)
摘要: int gy( int a,int b ) { return b==0?a:gy( b,a%b ); } 阅读全文
posted @ 2011-11-23 14:53 谈笑风生膜法师 阅读(337) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 下一页