This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
It was in one of the questions asked in one of the company interview exam... Will appreciate if you could give me the answer for the same..
Joined: Aug 03, 2002
The whole question looks like nonsense to me. What is the out on which the method read is called? And what is Char? Is it some special wrapper class? And While that's not even a Java keyword. And it's trying to assign an int to an array reference. Looks like that company is just trying to waste peoples time.
To be fair, it was an "interview exam". Something tells me that most of the "nonsense" is probably because it is from memory. Regardless, I agree with Barry, the question in its current incomplete state, just "waste peoples time".
While posting questions please verify whether you are posting them correctly or not.
The above code result in compiler error. First of all check the Statement what you are trying to assign to what and what you are checking and what the method will be returning. Secondly there is no method in the inputstream which takes the char array as an argument.