1.java is platform independent because it converts java file into class file which is having byte code and it can be run on every operating system.(not satisfied with my answer)... cross question: so java is having byte code bt why it is platform independent? mam,compiler convert it into bye code and then can be used on every platform .wth the help of jvm installed in the machine.converts that byte code into machine code... cross question: so jvm is platform dependent then how java is independent(i was like i what thing m still missing in my answer )...silence...for 10 sec..ok fine 2.what is byte code: i told her mam this was written in hexadecimal and only require interpreter and a few native libraries . 3.tell me about 12 methods of string?i started writing it on paper..concate..compareTo, charAt,equals,length,toString and rest i was not able to recall.. she taunt me again like u rate java as per ur knowledege so high and dont know about those methods.. 5.take my paper.and wrote System.err.println("Hello"); what is the output i didnt knw much about that bt the output will be same as sys.out.println(); the sequence may matters like System.err may print before or after the Sys.out execution. 6: i wrote a program on custom Exception...by extending classs wtih Exception and using throw& throws 7. mam, those exception which are requited and forced by the compiler to specify it like SQLException,IOException ,ClassNotFoundException etc are checked Exception and those which are not checked by the compiler at compile time like ArthematicException,ArrayIndexoutOfBound Exception etc. i think u r a bit confused manish ...think once again and answer .every exception will be runtime only... i was not so confident after dat..and finally told me dat that you have lot more o work on... v will see what we can do... thankyou. (move out of the room with a smile inside it was like"what the hell ....")
They will check your logical understanding by asking some algo e.g. sorting, searching algos and difficulty will depend on your exp. In my case array was given and interviewer asked me to do sorting with any algo.
Abstract classes provide very strong IS-A relationship and Interfaces can be seen as capabilities. When one need to give abstraction with some pre-defined functionalities we can should use abstract classes else interfaces can be used. So when there are similar kinds like we use abstract classes and if they also require different kind of capabilities(functionalities) we can provide it by interfaces. and sooo on.... explained them java specific rules of creating abstract classes and interfaces