Thanks MakPandian
I really appreciate your effort. I was bugging since yesterday. I am new in java.

07-19-2011, 04:13 PM

Dark

@makpandian, don't spoon feed. Especially not to people who are still learning the basics. You're not helping them learn by giving them code, they often will take this code and claim it as their own when they turn it in as an assignment.

07-20-2011, 06:58 AM

makpandian

Dark,
I strongly agree with you. This mistake will never ever ever happen again..

07-20-2011, 02:23 PM

Khan05

@ Dark
I am not agreed with you.I am new in Java field I don't really like to copy some one else code. But some time you don't understand some thing that's why people ask help from others. If you have knowledge and you share with some one else it will increase not decrease.This is the only reason people join Forums. @ ManPandian don't warry you can help the people they will appreciate.

07-20-2011, 02:56 PM

Norm

@Khan05 What did you learn from ManPandian's post?
Do you now know how to look thru the API doc for the classes with methods that will do what you want?

07-20-2011, 03:12 PM

Tolls

Quote:

Originally Posted by Khan05

@ Dark
I am not agreed with you.I am new in Java field I don't really like to copy some one else code. But some time you don't understand some thing that's why people ask help from others. If you have knowledge and you share with some one else it will increase not decrease.This is the only reason people join Forums. @ ManPandian don't warry you can help the people they will appreciate.

Sharing knowledge is teaching someone to fish.
What makpandian did was simply give you a fish.

07-20-2011, 03:47 PM

Dark

Like Toll said, You can give a man a fish and he will eat for a day, teach a man to fish and he will eat for the rest of his life.

@Khan05, Because it was handed to you I doubt you really even know whats going on in the code. What we would've done, is pushed you in the direction you needed to go in. Guided you towards your destination, forcing you to learn about everything you needed to know to finish your code. By making you figure out your own problems, with guided help, you will find you learn a lot more about it.

Code:

for(byte b:by){

Do you know the purpose of this loop? Why it was used instead of a different one? What the loop is actually doing? Why he used a b:by instead of a for(int i=0;i<lengthOfMyArray.length;i++)?

07-20-2011, 03:51 PM

Dark

@dr.code.skm, Make your own topic with your error message if it doesn't compile. If it does, then show us the expected output and the actual output. Formulate your question in an Short, Self Contained, Correct Example and make sure to be very clear with what the problem is.

07-20-2011, 04:08 PM

Khan05

@Dark. sorry,
I really like your fish example. I went through first java API list. I found some example. I did not figure out how to change into binary.But Dark you can help me to explain why he use for( b:by).
thanks Dark

07-20-2011, 04:21 PM

Dark

I can't claim credit for coming up with it, its been around since before I was even an egg inside of my mother.