Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Simone Aiello

Greenhorn
+ Follow
since Oct 13, 2010
Rome (ITALY)
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Simone Aiello

Dhanushanth Dhanu wrote:
normally we can add any string through concat behind the text
but my question is how can we add any string in front of the text?
like i need an out put like this "break Helloworld"
please any one give me an answer.



Did you try with

?
mmmh...maybe I wasn't clear...
I know how wildcards work... (I hope )

I asked why I can't use the super in a declaration,

whereas I can use the extends.
Why is it not possible to use the keyword super in a generic class declaration?




line #2 is ok...(i know the purpose )

why line #1 is wrong?
Right, you can't add anything to lt and lt1.

The compiler avoid to add the wrong type to a wild-card-collection( not "? super" ),
because Collections at runtime don't care about the type of elements.
Otherwise arrays provide to throw an Exception if you try to add an incompatible object

Stephan van Hulst wrote:Dear Simone, the fourth answer is correct because the thread running Test may have already completed before the main thread even reaches the Hello statement.

As a matter of fact, the Hello statement may be reached *at any time* during the execution of the Test thread.

The program could print any of these:

"Hello 0 1 2 3 4 Yes"
"0 Hello 1 2 3 4 Yes"
"0 1 Hello 2 3 4 Yes"
"0 1 2 Hello 3 4 Yes"
"0 1 2 3 Hello 4 Yes"
"0 1 2 3 4 Hello Yes"

Only two of these possible answers were listed in the options. These are 2) and 4).



Thanks, it's what I mean... although the sleep(2000) in Test makes the first answer ("Hello 0 1 2 3 4 Yes") more probably than others.
Or am I wrong?

Simone Aiello wrote:

If the count in Test starts before "Hello", means join is not called yet... so why other answers are incorrect?!



For other answers I mean output suggested like " 0 1 2 Hello 3 4 Yes"...

Himanshu S. Soni wrote:

2.) Hello 0 1 2 3 4 Yes

4.) 0 1 2 3 4 Hello Yes

The correct choices are : 2 and 4



I have some doubts... When join() is called, "Hello" is been already printed?
How is it possible the 4th answer is correct?
If the count in Test starts before "Hello", means join is not called yet... so why other answers are incorrect?!

Thanks! i missed the trailing empty strings...they are my worst nightmare, in regex matching too...
How does the split work?!

I run this code:


and I bumped in a strange behaviour...

I was expecting either 3 or 7 length string array,but I got 6 instead...
Today, while i was programming I hit on a never seen exception...
java.util.ConcurrentModificationException

I was trying to change elements of list on whose I was iterating using a foreach.
Maybe it never will appear on exams, but i thought it s the right thing sharing my experience...
A question from Snatis Self Tester asks if a private method could be overridden by a protected method.
I know a private method could never be overridden, thus i answered FALSE...making an error.
Is the santis tester wrong?

sumit kothalikar wrote:source:Examlab 1
1) why invoking method with one argument compiles and runs fine at line 1
even though we are asking for 2 parameters to be passed in the function getFormattedObject()
2) while at line 2 we are passing two parameters it compiles and gives IllegalStateException




The code above calls the group() method on Matcher mt1 two times. Hence it throws an illegalStateException;
The second time there is no matches found...

If you comment either line 14 or 15 (adjusting the system.out ) the code compiles fine and doesn't throws any exceptions.

is like write


the compiler doesn't ever know b will be initialized to 4, even if it's obvious that it occurs...