04 2015 档案

摘要:我的算法学习之路-lucida 阅读全文
posted @ 2015-04-26 21:37 陶修瑕 阅读(124) 评论(0) 推荐(0) 编辑
摘要:As usual, constructors are different from other kinds of methods. This is also true when polymorphism is involved. Even though constructors are not po... 阅读全文
posted @ 2015-04-25 20:51 陶修瑕 阅读(129) 评论(0) 推荐(0) 编辑
摘要:看不懂 1 import java.util.*; 2 3 class Value { 4 int i; 5 6 public Value(int i) { 7 this.i = i; 8 } 9 }10 11 public class FinalData... 阅读全文
posted @ 2015-04-23 20:57 陶修瑕 阅读(171) 评论(0) 推荐(0) 编辑
摘要:Create a simple class. Inside a second class, define a reference to an object ofthe first class. Use lazy initialization to instantiate this object. 1... 阅读全文
posted @ 2015-04-21 20:22 陶修瑕 阅读(176) 评论(0) 推荐(0) 编辑
摘要:If you want the references initialized,you can do it: 1.At the point the objects are defined.This means that they'll always be initialized before the... 阅读全文
posted @ 2015-04-21 17:47 陶修瑕 阅读(189) 评论(0) 推荐(0) 编辑
摘要:1 class A { 2 } 3 4 public class NewVarArgs { 5 6 static void printArray(Object... args) { 7 for (Object obj : args) { 8 Sy... 阅读全文
posted @ 2015-04-20 17:08 陶修瑕 阅读(269) 评论(0) 推荐(0) 编辑
摘要:1 public class ArrayOfPrimitives { 2 3 public static void main(String[]args){ 4 int[]a1={1,2,3,4,5}; 5 int[]a2; 6 a2=a1;... 阅读全文
posted @ 2015-04-20 13:40 陶修瑕 阅读(622) 评论(0) 推荐(0) 编辑
摘要:Create a class with a String field that is initialized at the point ofdefinition, and another one that is initialized by the constructor. What isthe d... 阅读全文
posted @ 2015-04-19 11:05 陶修瑕 阅读(149) 评论(0) 推荐(0) 编辑
摘要:The this keyword is also useful for passing the current object to another method: 1 class Person { 2 public void eat(Apple apple) { 3 Appl... 阅读全文
posted @ 2015-04-19 00:49 陶修瑕 阅读(119) 评论(0) 推荐(0) 编辑
摘要:1 public class Leaf { 2 3 int i = 0; 4 5 Leaf inceament() { 6 i++; 7 return this; 8 } 9 10 void print() {11 ... 阅读全文
posted @ 2015-04-19 00:33 陶修瑕 阅读(135) 评论(0) 推荐(0) 编辑
摘要:题目A vampire number has an even number of digits and is formed by multiplying apair of numbers containing half the number of digits of the result. Thed... 阅读全文
posted @ 2015-04-17 12:20 陶修瑕 阅读(167) 评论(0) 推荐(0) 编辑
摘要:1 import java.util.Scanner; 2 3 public class Fibonacci { 4 5 int fibo(int n) { 6 switch (n) { 7 case 1: 8 return 1;... 阅读全文
posted @ 2015-04-17 11:50 陶修瑕 阅读(141) 评论(0) 推荐(0) 编辑
摘要:1 package java_test; 2 3 public class labelWhile { 4 5 public static void main(String[] args) { 6 int i = 0; 7 outer: while (tr... 阅读全文
posted @ 2015-04-17 00:37 陶修瑕 阅读(1080) 评论(0) 推荐(0) 编辑
摘要:1 package java_test; 2 3 public class LabeledFor { 4 5 public static void main(String[]args){ 6 int i=0; 7 outer: //Cannot have... 阅读全文
posted @ 2015-04-17 00:27 陶修瑕 阅读(4719) 评论(0) 推荐(0) 编辑
摘要:1 public class primeTest { 2 3 public static void main(String[] args) { 4 5 int i, j; 6 for (i = 3; i < 100; i++) { 7 ... 阅读全文
posted @ 2015-04-16 21:32 陶修瑕 阅读(143) 评论(0) 推荐(0) 编辑
摘要:1 //THINGING IN JAVA P123 2 3 package java_test; 4 5 //Tests all the operators on all the primitive data types: 6 //to show which ones accept... 阅读全文
posted @ 2015-04-16 00:26 陶修瑕 阅读(145) 评论(0) 推荐(0) 编辑
摘要:1 package exercise; 2 3 class Tank 4 { 5 int level; 6 } 7 8 public class Assignment{ 9 public static void main(String[]args){10 Tan... 阅读全文
posted @ 2015-04-13 22:28 陶修瑕 阅读(249) 评论(0) 推荐(0) 编辑
摘要:if语句应写在某个代码块,或者方法中,否则实例化后,无法执行。所以eclipse纠错系统认为你少了一个大括号 阅读全文
posted @ 2015-04-01 00:42 陶修瑕 阅读(5274) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示