Win a copy of Rust Web Development this week in the Other Languages forum!

Oceana Wickramasinghe

Ranch Hand
+ Follow
since Mar 02, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Oceana Wickramasinghe

If my expiry date is 10th of march, does that mean i should take the test before 10th of march, or that i should schedule the test before 10th of march?
When using this code

i get the output :sddsfsdd

So its not returning empty strings.

But if i replace print with println

i get the output:




Can someone tell me why println prints empty strings but why print doesnt?
9 years ago
Hello guys, since days i've been struggling to figure out how quantifiers work. I used several sources including Kathy Sierra's book but none of them explain quantifiers in a way that i can understand. There are several things i dont understand about quantifiers, mainly it has to do with the way the clarifications are worded.

For example * means zero or more occurrences.What does "zero or more occurrences" exactly mean? Can someone simplify this statement for me.

Secondly, i want to know exactly how the mechanism works. If i were to match the string "nnnnnnuuuuuuuuulllll" with the pattern "nu" followed by each quantifier, i would get

"nuuuuuuuuu" with +
"nnnnnnuuuuuuuuu" with *
"nnnnnnu" with ?

What exactly happens in the background when i execute this? I want someone to explain step by step why each quantifier behave the way they do. Why am i getting multiple "n"s and "u"s when what i want it to search for is "nu"? Its like quantifiers break down the pattern and treat each character as a different pattern.

Thanks in advance.
9 years ago
Okey, i broke the loop and it worked, thanks for your help.
9 years ago
Whatever is written in the file im reading is what i consider to be the actual value. Now if i were to just print the value i could have used println(s) within the loop, but i want to read this value outside this loop. Something like this

Is there a way around this?
9 years ago

The while loop eventually executes whats declared inside its semicolons,so whenever you attempt to access 's' outside the loop you get a null value. But i want the actual value. Is there any way to achieve this? Thank you.
9 years ago
So i guess this means that changes made within a constructor that is associated with a particular instance, does not apply to other instances?
9 years ago

Matthew Brown wrote:Can you QuoteYourSources please?

I actually ran into this myself while writing a program.
9 years ago
Thanks guys it was really helpful.
9 years ago
Can someone explain why does it print null? Im sure it has something to do with the constructors but i cant figure it out. Thanks

9 years ago
Do you get questions where you have to make conversions at the exam?
Well all i know is that main being a static method doesnt allow me to access 'x' nor 'a'. Does that mean no object is created, and that limitation is there prevent me from accessing a non existent object?
This question arised because of my lack of understanding of the basic principles of java execution. To the best of my knowledge main() is the entry point of a java program, and anything inside a method is to be executed by the JVM, please correct me if im wrong. In the following program

the code for the object is placed outside the main method, or any method. So does that line of code get executed, is an object created when i run this program, or is it not created because i placed the code outside the main method? thank you.
What, i didnt even know anything about a hand on course, whats that?