Java英文面试题(核心知识篇)

更新时间:2023-07-12 22:55:09 阅读: 评论:0

Java英文面试题(核心知识篇)
Question: What is transient variable?
Answer: Transient variable can't be rialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.
Question: Name the containers which us Border Layout as their default layout?
Answer: Containers which us Border Layout as their default are: window, Frame and Dialog class.
Question: What do you understand by Synchronization?
Answer: Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. I
n non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object's value. Synchronization prevents such type of data corruption.
E.g. Synchronizing a function:
public synchronized void Method1 () {
// Appropriate method-related code. 
}
E.g. Synchronizing a block of code inside a function:
public myFunction (){
synchronized (this) { 
// Synchronized code here.
}
}
Question: What is Collection API?
描写桂花Answer: The Collection API is a t of class and interfaces that support operation on collections of objects. The class and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces. 
Example of class: 营业成本率HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.
Example of interfaces: Collection, Set, List and Map.
Question: Is Iterator a Class or Interface? What is its u?
Answer: Iterator is an interface which is ud to step through the elements of a Collection. 
Question: What is similarities/difference between an Abstract class and Interface?
海兰珠皇太极
Answer:  Differences are as follows:
Interfaces provide a form of multiple inheritance. A class can extend only one other class.
三星堆简介Interfaces are limited to public methods and constants with no implementation. Abstract class can have a partial implementation, protected parts, static methods, etc.
A Class may implement veral interfaces. But in ca of abstract class, a class may extend only one abstract class.
Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract class are fast. 
Similarities:
Neither Abstract class or Interface can be instantiated.
Question: How to define an Abstract class?
Answer: A class containing abstract method is called Abstract class. An Abstract class can't be instantiated. 
小猪羔子
Example of Abstract class:
abstract class testAbstractClass { 鲫鱼炖茄子
protected String myString; 
public String getMyString() { 
李白诗词
return myString; 
public abstract string anyAbstractFunction();
}
Question: How to define an Interface?
Answer: 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;
}
Question: Explain the ur defined Exceptions?
Answer: Ur defined Exceptions are the parate Exception class defined by the u
r for specific purpod. An ur defined can created by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions.
Example:
class myCustomException extends Exception {
// The class simply has to exist to be an exception
}
Question: Explain the new Features of JDBC 2.0 Core API?
Answer: The JDBC 2.0 API includes the complete JDBC API, which includes both core and Optional Package API, and provides inductrial-strength databa computing capabilities.
New Features in JDBC 2.0 Core API:
Scrollable result ts- using new methods in the ResultSet interface allows programmatically move the to particular row or to a position relative to its current position
JDBC 2.0 Core API provides the Batch Updates functionality to the java applications.
Java applications can now u the ResultSet.updateXXX methods.
New data types - interfaces mapping the SQL3 data types
Custom  mapping of ur-defined types (UTDs)
Miscellaneous features, including performance hints, the u of character streams, full precision for java.math.BigDecimal values, additional curity, and support for time zones in date, time, and timestamp values. 

本文发布于:2023-07-12 22:55:09,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1079029.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:面试题   营业   羔子   鲫鱼   条件   知识   成本
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图