JAVA interview questions interview often often test knowledge 1

1.java which provides two mechanisms for polymorphism
answer: polymorphism (overloaded method to achieve) compile-time and run-time polymorphism (method to achieve coverage)

2. The difference between overloading and covered
a lot of people tend to confuse, it can be simple to understand: overloading is using a different method to distinguish the parameters; and said cover different content method body.

3. How to get the class name of the parent class
getClass (). GetSuperclass (). GetName ()

What is the difference 4.this super and
this shape is used to distinguish the reference member variables and methods of
super member variable or method to access the parent class

5. What are the internal class
member inner classes, static inner classes, local inner classes, anonymous inner classes

6. abstract classes and interfaces
interfaces need to implement the design concept: has-a relationship
abstract class can only be inherited, the design concept: is-a relationship

7. The composition and inheritance
combination refers to the original class to create an object reuse existing class functionality, design concepts in the new class which: has-a relationship
Inheritance refers to the characteristics of the subclass inherits the parent class, the design concept: is- a relationship

8.java initialization sequence of
the parent class static variables, static code block parent class, subclass static variables, static code block subclass, the parent class non-static variable, non-static block parent class, a parent class constructor, non-static subclass variable, non-static block subclass, the subclass constructors (when memory, a set of four front, rear three groups of three)

Continuously updated in ...

Guess you like

Origin blog.csdn.net/fallwind_of_july/article/details/88077889