美文网首页
Core Java面试问题整理

Core Java面试问题整理

作者: SummerDreamEve | 来源:发表于2018-12-18 05:13 被阅读0次

    参考:https://github.com/MindorksOpenSource/android-interview-questions#core-java

    OOP:Explain OOP Concepts.

    Java OOPs Concepts - Javatpoint

    Object-Oriented Programming is a methodology of designing a program using classes, objects, inheritance(继承), polymorphism(多态), abstraction(抽象), and encapsulation(封装).

    Differences between abstract classes and interfaces? 

    An abstract class is a class that contains both concrete and abstract methods (methods without implementations). An abstract method must be implemented by the abstract class sub-classes. Abstract classes cannot be instantiated and need to be extended to be used.

    An interface is like a blueprint/contract of a class (or it may be thought of as a class with methods but without their implementation). It contains empty methods that represent, what all of its subclasses should have in common. The subclasses provide the implementation for each of these methods. Interfaces are implemented.

    What is the difference between iterator and enumeration in java?

    Do you agree we use composition over inheritance? Composition vs Inheritance

    Difference between method overloading(重载,compile-time) and overriding(重写,runtime).

    重写 vs 重载

    1. Overloading happens at compile-time while Overriding happens at runtime: The binding of an overloaded method call to its definition happens at compile-time however binding of overridden method call to its definition happens at runtime. More info on static vs. dynamic binding: StackOverflow.

    Static methods can be overloaded which means a class can have more than one static method of the same name. Static methods cannot be overridden, even if you declare a same static method in child class it has nothing to do with the same method of parent class as overridden static methods are chosen by the reference class and not by the class of the object.

    2. Overriding is all about giving a specific implementation to the inherited method of parent class.

    Difference between Static and final ?

    java - Difference between Static and final? - Stack Overflow

    Differences between Exception and Error ?

    相关文章

      网友评论

          本文标题:Core Java面试问题整理

          本文链接:https://www.haomeiwen.com/subject/snzhkqtx.html