This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.

Yuan Du

Ranch Hand
+ Follow
since Nov 20, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Yuan Du

Thank you James!
Thank you Ankit!
Danke Jothi!!!
15 years ago
Hi friends,

for(int i = 0; i< 1000; i++){
System.out.println("THANK YOU!!!");
}

Yours,

Yuan
15 years ago
Hi everyone,

Why we can't mark Inner class methods and instance variables as static?

Thank you!

Yuan

Sachin Adat wrote:

Abhi vijay wrote:But, If I change the input String to
a1a2a34a56789aaa, still the noof tokens generated is 5. Why so??


What's the explanation to this?



Hi Sachin,

Actually public String[] split(String regex) invokes the overloaded method public String[] split(String regex,
int limit)[/b] with limit 0.

If the limit is zero then the regex pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded.


Yuan
Ok Thank you , i got it.

Yuan
Hi everyone,

is there any difference between " " and "\\s"?

Thank you!

Yuan

new String[1]{"Sun Certified"};


will this compile?
Ok, thank you Punit.
I got it.


Yuan
oh, sorry, i meant one element of object array 'a'.

eg.Arrays.binarySearch(a, a[0]);
Ok Punit.
You mean i should use the method "public static <T> int binarySearch(T[] a, T key, Comparator<? super T> c)",
but i can not code it in two statements
like


because the sequence of the object[] won't be changed after the first statement, am i right?

Thank you!

Yuan
Hi everyone,

This is from KB book page 558
When solving searching and sorting questions, two big gotchas are:
1. Searching an array or collection that hasn’t been sorted.
2. Using a Comparator in either the sort or the search,
but not both

I don't understand the second point, why we can't use a comparator for sorting and searing.

Thank you very much!

Yuan
Hi everyone,

I'm not really clear about Invoking a Superclass Version of an Overridden Method in combination with modifying/invoking of instance variables( from Super or Sub).

Could you please make some examples to make it clear? Thank you!

Yuan
Hi Ankit,

I'm not really clear, why the return type of process must be a List, not ArrayList or LinkedList or something else, which inherits from List?

Okey, i think i got it. because List cannot be assigned to ArrayList or LinkedList. Am i right?

Yuan