各種面試問題匯總

1.JAVA變量什么時候需要初始化?

像memo[][]這樣的 類的成員變量不需要,因為JVM會自動給其賦值;

像類里面的變量是一定要初始化的;


2.encapsulate封裝的概念;


3.concurrent collection interfaces provided

BlockingQueue

ConcurrentMap

ConcurrentNavigableMap


4.Apache dubbo是基于什么傳輸?shù)模?/p>


5.整個Spring的工作原理?


6.JAVA8的各個集合的使用?


7.你使用過的微服務以及@Component?


8. 關于抽象方法正確的是?

abstract是需要被繼承使用的,所以它不能被final使用,所以A錯,也可以有private屬性,B錯,也可以有普通方法 甚至所有都可以是普通方法,當然這樣也就失去了abstract類的意義,C錯,interface屬于特殊的abstract類,也是abstract類,所以D對


9.怎么講清楚Spring和Spring Boot的原理?


10.Microservices的缺點有哪些?

1)架構(gòu)復雜;2)多服務運維難度;3)系統(tǒng)部署依賴;4)服務間通信成本;5)數(shù)據(jù)一致性;6)系統(tǒng)集成測試;7)重復工作;8)性能監(jiān)控;

正常情況下,需要從成本、復雜度、測試、監(jiān)控等方面出發(fā);


11.什么是OOP?

Mira Tan Yay!!!!!!!!!! And Xin Tan Yay!!!!!!!!!!

on the concept of?classes?and?objects, a class is abstract and used to create more specific objects, and also classes contain functions, called methods available only to that specific type of object.

class templates are used as blueprint to create individual objects.

Secure, protects information through encapsulation

classes are essentially?user defined data types

Objects are?instances of classes?created with specific data

Attributes are defined in the?Class?template

Methods represent behaviors. Methods perform actions;?

Four Principles of OOP: Inheritance, Encapsulation, Abstraction, Polymorphism

Inheritance supports reusability

Encapsulation means containing all important information?inside an object, and only exposing selected information to the outside world.

Abstraction means that the user interacts with only selected attributes and methods of an object. Abstraction uses simplified, high level tools, to access a complex object.

Polymorphism means designing objects to?share behaviors.?

Method Overloading:Compile Time polymorphism

Method Overriding:Runtime polymorphism,運行的時候才知道

Looking at how to break up the requirements into simple, reusable classes that can be used to blueprint instances of objects. Overall, implementing OOP allows for better data structures and reusability, saving time in the long run.


12.什么是Spring?

Spring understand the different annotations added by developer on the top of classes, create an instance of the class and Spring manage it.


13.說一下 HashMap 的實現(xiàn)原理?


14.集合fail fast原理

15.實現(xiàn)一個MaxStack

16.interface可以有static methods嗎

可以有,還可以有default方法;

interface里的方法都必須是final abstract

JAVA8前接口的方法都必須是abstract的,因為是抽象的,所以要實現(xiàn),而且只能是public的,想想為什么?

接口中的變量是常量,即public static final

JAVA8之后可以有非abstract的default方法(不能用類直接調(diào)用,可以override),而且可以有static的方法(可以用類直接調(diào)用)


17. 解釋下Java Interceptor Controller和Servlet

18. thread wait for 1 sec有什么方法?

19. JAVA String和JAVA Collection有什么區(qū)別?

20. 用SQL實現(xiàn)一個join語句,包括left join和right join.

21. HashMap和TreeMap的區(qū)別?一個有序一個無序


21. 什么是泛型?

泛型是一種約束,一種規(guī)則,是一種安全機制;非常常見的ArrayList類就是一個泛型類;不知道使用什么類型來接收的時候,此時可以使用?,?表示未知通配符;https://www.zhihu.com/question/272185241

就好比作文題材不限,但一次只能寫一種題材,至于是什么題材,由我們自己定。



22. Web API和JAVA API的區(qū)別

Web API,一般指基于http的編程接口,接口一般定義HTTP的:請求方法、請求路徑、參數(shù)、響應數(shù)據(jù)格式、響應http code等。至于http server,可以用Java、.Net、nodejs等各種框架實現(xiàn),http server屬于Web API的實現(xiàn);

API(Application Programming Interface),指應用程序編程接口,可以看看這些API你就會用了,而不用知道里面的詳細細節(jié);


23. Object的equals方法和String的equals方法是不同的

如果沒有單獨的equals方法,得繼承Object的equals方法;

equals默認是比較地址值的,比較地址值是沒有意義的;

==如果基本類型是比較值,引用類型是比較地址;


24. 抽象類可以不包含抽象方法,但如果中包含抽象方法,就必須將該聲明為抽象類

25. 數(shù)據(jù)庫的幾大鍵, Foreign Key

26. B-tree, transient關鍵字

27. db的index怎么發(fā)生的;

28. Application, Request, Session, Page

29. 子類中可以new一個父類嗎?

30. 反射

31.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容