热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

Core Java 面试题与答案

Test your skills through the online practice test: Core Java Quiz Online Practice Test

问题 86. How to define an Interface in Java ?

In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.
Emaple of Interface:

public interface sampleInterface {
	public void functionOne();
	public long CONSTANT_ONE = 1000; 
}

这有帮助吗? 添加评论 查看评论
 

问题 87. How many methods in the Serializable interface?

There is no method in the Serializable interface. The Serializable interface acts as a marker, telling the object serialization tools that your class is serializable.

这有帮助吗? 添加评论 查看评论
 

问题 88. How many methods in the Externalizable interface?

There are two methods in the Externalizable interface. You have to implement these two methods in order to make your class externalizable. These two methods are readExternal() and writeExternal().

这有帮助吗? 添加评论 查看评论
 

问题 89. What is the difference between Serializalble and Externalizable interface?

When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject() two methods to control more complex object serailization process. When you use Externalizable interface, you have a complete control over your class's serialization process.

这有帮助吗? 添加评论 查看评论
 

问题 90. Can an Interface have an inner class?

Yes.
public interface abc{		
	static int i=0; 
	void dd();		
	class a1{			
		a1(){
			int j;
			System.out.println("inside");
		};
		public static void main(String a1[])
		{
			System.out.println("in interfia");
		}
	}	
}

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。