Interview Questions and Answers - Order By Newest 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   Q2222. How to instantiate jsp variable from another jsp? JSP
Ans. using session attribute.
session.setAttribute("userId",userId);
in first jsp
int userId=session.getAttribute("userId");
in second jsp; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q2223. 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   Q2225. 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 Q2226. 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   Q2227. 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 Q2228. 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 Q2229. 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 Q2230. 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 Q2231. 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 Q2234. 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 Q2235. 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 Q2236. 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 Q2237. 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 Q2238. 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 Q2239. 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 Q2240. 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 Q2242. Design ATM machine application using oops. Design
This question was recently asked at 'Atos'.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 Q2243. Can we have private methods in interfaces ? Core Java
Ans. Yes, With Java 9 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9 Q2244. What could be the reason for allowing private methods in java 9 ? Core Java
Ans. Java 8 allowed for method implementation using default methods in interfaces. As those default methods could contain complex logic and might need organizing the logic into multiple methods, they have allowed for private methods. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  default methods Q2245. What is the difference between WebApplicationContext, ApplicationContext, DispatcherServlet, and rootContext in Spring framework? Spring
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   Q2246. If you are given a choice to decide a Programming language for an application , what factors would you think of before deciding on the language to build it ? Design
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   Q2247. What are the components of Data Warehousing ? Database
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   Q2248. What is the difference between implementing interfaces and inheritance 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   Q2249. How many Java developers are there in world ? General
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   Q2250. What is Test driven development ? Process
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