I was going through some of the programs. The following two program's output caught me confused.
The answer is: 0 0 3 0.
I could not understand why does it print 3 at the 2nd index.
Answer: It does not compile.
But if we replace Boolean by string it complies. Why we cant sort a boolean array?
About quote the source: I am sorry, I dont remember the exact source. I have been solving from miscellaneous sources on the internet and I put all my doubts in a word file as and when I encounter them. Henceforth, I will take the responsibility of making a note of the source too. (Its unlikely to get the real questions though )
1.) Anytime you post code examples to a testing forum, we require that you include a valid source. See: Quote Your Sources for more information. You can add a source to this post by clicking on the icon in the top post of this thread.
2.) Whenever you post more than 1 or 2 lines of code to JavaRanch, be sure to wrap your code in a set of UBB CODE tags. Doing so will preserve your indentation making the code much easier to read. If your code is easier to read, you stand a much better chance of having someone knowledgeable read it and answer your question for you.