1) What makes java a platform independent language ?
- First of all, here platform independent means compiled java programs can run on any platform, not depending on which platform it was built. The reason behind this is, compilation of java source code is converted into byte code, which can run on any platform.
// More on Java byte code(Java byte code, made easy)
- No, Java does not support multiple inheritance. (We can use multiple inheritance through interface)
- James gosling in "Java: an overview" gave idea on why multiple inheritance is not supported in Java that as per designer's view multiple inheritance causes more problems and confusions than it solves. So, to let the Java language be simple, multiple inheritance feature is omitted.
- Over-loading of methods :- When there are two methods in a class having same name but different types of parameters or different numbers of parameters, it is called over-loading of methods
- Over-riding of methods :- When a method in child class has same method as in parent class, it is called over-riding of methods. Here, same method means, same name of methods, same parameters type and number.
No comments:
Post a Comment