Monday, June 1, 2020

i-nutics Interview question


1.        Method overloading  and method overriding
2.       Return type of method overriding  is same or diff.
3.       what is covariant type
4.       Singleton deign pattern
5.       hash table how to work hash table
6.       jdk5 feature
7.       what is generic
8.       element of jsp
9.       hibernate cashe  ?
10.   what is struts
11.   how to use filter in struts
12.   how to use interceptor ?
13.   how to use localization or internationlization 
14.   join
15.   what is enum ? why we use it
16.  How to make HashMap object Synchronized? (without using any  keyword)
17.   HashMap hm= new HapsMap();
1.Collections.Synchronized(hm);
or
2.use ConcurrentHashMap chm= new ConcurrentHashMap ();
Is it possible to define class inside an Interface??
18.   Java inner class or nested class is a class i.e. declared inside the class or interface.
19.interface employee{
20.class Role{
21.      public String rolename;
22.      public int roleId;
23. }
24.Role getRole();
25.// other methods
26.    
27.  Specifying a class inside an interface ties that class directly to that interface - clients who use that interface will have access to that class and all the functionality that it provides.
28.   
29.  I've seen the pattern of a class inside an interface really only in Java 1.4 and lower to provide an enumerated type to go along with the interface - since the interface could only use the class, and the class can be protected, clients that use the interface could only accept the instances of the class defined in the interface as the enumerated values. That's just the only example I can come up with - I'm sure others exist, but it's rare that I see a class inside of an interface used.
30.    





What is the specialty in private data member as comparing it to
  Public member. (apart from inheritance,package/class access level)
public member can be modified directly inside main() by using object of that class, where as we can't directly alter the value and we need a public setter() to alter the value of private data member.