Roman Tomach

Greenhorn
+ Follow
since Mar 17, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Roman Tomach

Originally posted by Nicky Eng:
I wonder why the answer given to me is C.
state your answer and explanation why you pick that answer.


Right answer is D because there are no no-arguments constructors in class Super. So, there are two solutions to compile without errors: create no-arg constructor in class Super or explicitly call super(text) in class Sub.
Try to add .(dot) to classpath variable.

Originally posted by amit taneja:
string f will not be initialized to null when its declaring under local method or local static method...


Yes, you're right. Look at the code in the first post:


These are not instance variables.

Originally posted by vidya sagar:
String f1 = null;
Its same as just declaring as String f1;


Not in this case. Method variables are not automatically initialized.

Originally posted by Alan Moore:
Okay, try this regex:


Excellent! This is exactly what I need. Thank you very much!
18 years ago

Originally posted by Alan Moore:
I still don't understand what's supposed to happen, though. Can you give us some more information about what you're trying to do?


All I need is to make this expression to match both

and

because link here is optional.
18 years ago

Originally posted by Ashok Kumar:

The continue stmt will cause an infinite loop and not loop for 3 times,because each time i is initialized to 0.So the for(i<3)condition is always satisfied.


AFAIK, continue statement just breaks current iteration. So, loop variable is incremented.
Thank you! Sorry, I forgot to write this in my post.
If I add "?" a have the following result:

But I need this result:
18 years ago
Because after "continue outer" the value of "age" is still 16. So it never be incremented.
Hi all!

I have trouble with reluctant mode. There is my code:


Unfortunately, I can't make this pattern to work properly. If I change pattern from "<b>(.*)</b>.*?(?:<a href=\"(.*?)\")?" to "<b>(.*)</b>.*?(?:<a href=\"(.*?)\")+" this works. But this url pattern is optional here.

Please advise me how I should change the expression?

Thanks a lot!
18 years ago