All the questions are really used in many interviews.
And all of them are collected by my friend - Hareluya, graduated from the university of Bristol.
**************************************************************************
The difference between a static and non-static variable in a class definition.
A static variable is associated with the class as a whole rather than with specific instancesof a class. Non-static variables take on unique values with each object instance.
What are the differences between Java and PHP?
PHP and Java are completely different languages. PHP is only web based, while Java is mainly client based (although can used on the web through java applets). Both PHP and Java have their complete separate interpreters, and they are both essentially guided towward different purposes.
Java is mainly used for creating software that runs on the computer,
PHP is mainly used for creating websites.
About complexity of very standard algorithms.
N/A
The difference between Java and C++
From author: you can find many aspects of differences between them, but the following answer is enough for an interview.
Everything is an object in Java (Single root hierarchy as everything gets derived from java.lang.Object). Java does not have all the complicated aspects of C++ ( For ex: Pointers, templates, unions, operator overloading, structures etc..) The Java language promoters initially said "No pointers!", but when many programmers questioned how you can work without pointers, the promoters began saying "Restricted pointers." You can make up your mind whether it’s really a pointer or not. In any event, there’s no pointer arithmetic. There are no destructors in Java (automatic garbage collection). Java does not support conditional compile (#ifdef/#ifndef type). Thread support is built into java but not in C++. Java does not support default arguments. There’s no scope resolution operator :: in Java. Java uses the dot for everything, but can get away with it since you can define elements only within a class. Even the method definitions must always occur within a class, so there is no need for scope resolution there either. There’s no "goto " statement in Java. Java doesn’t provide multiple inheritance (MI), at least not in the same sense that C++ does. Exception handling in Java is different because there are no destructors. Java has method overloading, but no operator overloading. The String class does use the + and += operators to concatenate strings and String expressions use automatic type conversion, but that’s a special built-in case. Java is interpreted for the most part and hence platform independent.
Questions about Web Technologies like HTML, JavaScript.
N/A
Questions about sql server
N/A
How do you define inheritance and polymorphism?
This can be a confusing topic because one can argue that sharing method attributes between a super or abstract class with a derived class could be described by either Polymorphism or Inheritance. One significant differerence could be illustrated as to when or under what circumstances you would you use one or the other.
An ideal instance of using Inheritance would be when you want to create an entirely new class, but wish to borrow a group of existing attributes or methods resident in an existing Abstract or super Class, instead of re-inventing the wheel. If you had an Abstract Class Carnivore and wanted to create a subclass Cat, you could instantly inherit all the methods that were common in Carnivore that applied to Cat without writing new code.
Polymorphism could be best applied when you had an existing SubClass that you wanted to modify or add a feature that could borrow a method that existed in a higher class. Take the Cat subclass, which inherited attributes from Carnivore, and you wanted to add the method Stalk, which would generically describe how a carnivore approaches its prey. However its implementation in Cat would detail the stealth it uses that are unique to a Cat.
Questions about design concepts
N/A
Garbage collector in Java - How does it work
to be continued...