26. Can Enum extend class in Java? (No, because Java allows a class to only extend one class and enum by default extendsjava.lang.Enum,see here for moreEnum interview questions) 27. How to prevent your class from being subclassed? (Make it final or make constructor private) 28. Can we...
29.怎么检测一个线程是否拥有锁 在java.lang.Thread 中有一个方法叫 holdsLock (),当且仅当当前线程拥有某个具体对象的锁时它返回true。 30.你如何在 Java 中获取线程堆栈 eak 组合键来获取线程堆栈,Linux 下用 kill -3 命令。你也可以用 jstack 这个工具来获取,它对线程 id 进行操作,你可以用 jps 这个工...
Java is not completely object-oriented language as it provides the use of primitive datatypes (like `int`, `char`) which are not objects. 60) Explain singleton class in java. How can we make a classsingleton? A singleton class makes sure there is onlyone instance. Example: public class S...
Once you have applied, these interview questions will help you in combination with the knowledge gained in the Java training course. Here’s an updated list of top Java interview questions and answers that’ll help you in Java interviews. Top Java Interview Questions and Answers – Set 1 1)...
4.Struts Interview Questions and Answers Struts2 is one of the modern Java Web Application framework. This article contains a list of 30 questions with answers for Struts2 framework. 5.Spring Interview Questions and Answers Spring Framework is the most widely used Java EE framework. It’s built...
● final关键字除了修饰类之外,还有哪些用法呢? final修饰的变量,一旦赋值,不可重新赋值; final修饰的方法无法被覆盖; final修饰的实例变量,必须手动赋值,不能采用系统默认值; final修饰的实例变量,一般和static联用,用来声明常量; 注意:final不能和abstract关键字联合使用。
Java Exception Interview Questions Here I am providing some of the important core java interview questions with answers that you should know. You can bookmark this post to brush up on your knowledge before heading for an interview. 1. Name some important features of the Java 14 release?
Basic Java Interview QuestionsBelow are five examples of basic java problems. These questions are simple in nature, testing only one concept. They are meant to be solved in a collaborative integrated development environment (IDE). You can access the sample inputs, sample outputs, and base code ...
143、什么叫对象持久化(object persistence),为什么要进行对象持久化? 持久化的对象,是已经存储到数据库或保存到本地硬盘中的对象,我们称之为持久化对象。为了保存在内存中的各种对象的状态(也就是实例变量,不是方法),并且可以把保存的对象状态再读出来。我们可以使用Java提供的序列化机制。
This Java interview question is from my list of Top 15 Java multi-threading question answers, Its getting popular day by day because of huge demand of Java developer with good concurrency skill. Answer of this Java interview question is that former returns an object of Future which can be use...