Below 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 for each question by ...
An analysis of a simple Java basic interview question: short s1=1; s1 = s1 +1 will report an error? packagecommon;publicclassShortTypeTest {/** @param args*/publicstaticvoidmain(String[] args) {//TODO Auto-generated method stubShort s1 = 1; s1 = (short) (s1 + 1);//simple typeS...
such as MySQL and Oracle. This article has a collection of 40+ interview questions related to the JDBC API. They cover areas from basic Connection to DataSource to Connection Pooling. It will help you in interviews for questions
The first two articles: Java Basics Common Knowledge Points & Interview Questions Summary (Part 1), the latest version in 2022! Java basic common knowledge points & interview questions summary (in), the latest version of 2022 abnormal Java exception class hierarchy diagram overview: What is the ...
Java Basic Interview Questions 1. Why is Java a platform independent language? Java language was developed in such a way that it does not depend on any hardware or software due to the fact that the compiler compiles the code and then converts it to platform-independent byte code which can...
What are the basic interfaces of Java Collections Framework? Collection is the root of the collection hierarchy. A collection represents a group of objects known as its elements. The Java platform doesn’t provide any direct implementations of this interface. Set is a collection that cannot contain...
Java Interview Questions/Java面试题 . What is transient variable? Transient variable can't be serialize. 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 ...
Why this Java question?It is one of the java interview questions for freshers. Of course not 100% freshers, but this question tests understanding of basic design principles, and the ability to apply them. In particular, adhering to the “open to extension, closed to modification” principle ...
Sorry that seems to be basic or silly question, but am confused and need a little help here. Can you kindly please brief on this. I had completely drifted away by the explanation of random/fixed hashcode() value for key. ——— When hashcodes for different objects are recommended to be...
An excellent answer to this interview question is “because they are incompatible“. TheCollectioninterface has a methodadd(Object o). TheMapcan not have such a method because it needs key-value pair. There are other reasons also such asMapsupportsEntrySet etc.Collection classes do not have suc...