4 ms·
Maybe the answer is that String is a class and string has no special meaning in Java? It could be that the author was shown a bit of code where an instance of
by jakejake 14y ago
Maybe the answer is that String is a class and string has no special meaning in Java?
It could be that the author was shown a bit of code where an instance of a String was called string (I've seen this many times as an argument name especially in methods for converting or manipulating a String value). But since the code wasn't mentioned we have no idea,
Seems like a nasty trick question to ask of an intern who doesn't know Java!
- pjungwir 14y agoI agree if it was asked with no context ("What's the difference between String and string?"), I wouldn't be sure how to answer either! (But in the OP, wasn't it the author who asked the question?) It reminds me of an interview question I was asked once (thought not as bad as String/string): "What is the time complexity to print every node in a binary tree?"