Interview Questions and Answers - Order By Newest Q1311. Which are the thread safe / synchronized / concurrent classes in java collections ? Core Java
Ans. Stack
Properties
Vector
BlockingQueue
ConcurrentMap
ConcurrentNavigableMap Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  collections  concurrent classes Q1312. What are the differences between Intermediate and Terminal Operations in Java 8 streams? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1313. What is the difference between Collections.emptyList() and creating instance of a list ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1314. Which are the classes that implement java.util.List interface ? Core Java
Ans. ArrayList
LinkedList
Vector
Stack Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1315. Why do you think that Stack collection class implement List interface ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1316. What is the there only one method declared in Runnable interface? Core Java
Ans. The Runnable interface describes a class whose instances can be run as a thread. The interface itself is very simple, describing only one method ( run ) that is called automatically by Java when the thread is started. The Runnable interface is usually used in conjunction with the Thread class. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1317. What is difference between Executor.submit() and Executer.execute() method ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1318. What is difference between CyclicBarrier and CountDownLatch in Java ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1319. What do you mean by synchronized Non Access Modifier? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1320. Name few classes of java.util.regex package ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1322. Explain toString method ? Which class contains this method ? Core Java
This question was recently asked at 'NEC Technologies'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1324. What will the following code print and Why
class Class1 {
static{
System.out.println("Wow");
}
public static final int xyz=1;
}
class Class2{
public static void main(String[] args) {
System.out.println(String.valueOf(Class1.xyz));
}
} Core Java
Ans. 1
Reason being that Class1.xyz is replaced with 1 during pre compilation only and a reference to Class1 is never made. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  static final   pre compilation Q1325. Why java allows explicit import of class final static elements but not others ? Core Java
Ans. Because they can be replaced easily in pre compilation whereas others cannot. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1326. Why do we have multiple core java jars in java 9 ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q1327. What is the concept of modules in Java 9 ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q1328. How modules are different than packages in Java 9 ? Core Java
Ans. Modules are independently build units and contains multiple packages. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q1329. How Java 9 helps in building light weight applications ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q1330. Do we need different class loaders for different modules in Java 9 ? Core Java
Ans. No, We can use the same class loader. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modulesAns. A Module layer is created from a graph of modules and is a function that maps modules to their class loaders. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q1333. Difference between named and unnamed modules ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q1334. What is the use of Requires, Exports, Opens and provides within Module Descriptor ? Core Java
Ans. Requires specifies the dependencies for the module, i.e the modules required for this module to function.
Exports specifies the packages exported by the module.
Opens specifies the packages opened by the module.
Provides specifies the services provided by the module
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q1335. Does Java 9 allows same package within different modules ? Core Java
Ans. Yes it allows if the modules are mapped to different class loaders. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q1336. What are the qualified and unqualified packages ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q1337. How does modularity in Java 9 facilitates better encapsulation ? Core Java
Ans. By providing dependencies , services and exports explicitly Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q1338. How does Java 9 provides backward compatibility with libraries that haven't published themselves as modules ? Core Java
Ans. Though Automatic modules. Any JAR on the module path without module descriptor ends up as automatic module Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q1339. What is the default setting for Automatic modules regarding exporting packages and reading modules ? Core Java
Ans. As one purpose of automatic module is to provide backward compatibility with the module less dependencies, automatic modules exports all packages and include all other modules. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modulesAns. JShell is a feature in java 9 using which we can code and test without compiling using javac and see the result of calculations directly. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  jshell  java 9