Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Rarely asked Interview Questions and Answers - 72 question(s) found - Order By Rating | ||||
| ||||
Ans. The equals contract is said to be transitive if obj1.equals(obj2); and obj2(.equals(obj3) then obj1.equals(obj3) also returns true. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Transitive equals contract   rare | ||||
| ||||
Ans. Yes, We are using requireNonNull method for validating if the object is null. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  objects  util methods   rare | ||||
| ||||
Ans. There is one VTable for each class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  virtual table method  vtable  runtime polymorphism  object oriented programming (oops)  oops concepts   method overriding intermediate   rare | ||||
| ||||
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  virtual method table   method overriding  runtime polymorphism  object oriented programming (oops)  oops concepts expert   rare | ||||
| ||||
Ans. The Model/View/Controller pattern, a strategy for dividing responsibility in a GUI component. The model is the data for the component. The view is the visual presentation of the component on the screen. The controller is responsible for reacting to events by changing the model. According to the MVC pattern, these responsibilities should be handled by different objects. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  mvc  design pattern Asked in 1 Companies   rare | ||||
| ||||
Ans. The intent of this question is to see what values as a employee you have. So answer this cautiously as they will try to judge you on the basis of this answer. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies   rare | ||||
| ||||
Ans. TreeSet contains only values as elements whereas TreeMap contains Key value pairs. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  reeMap  TreeSet  Collections  sorted collection Asked in 1 Companies   rare | ||||
| ||||
This question was recently asked at 'Symantec'.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  web application   url Asked in 1 Companies   rare | ||||
| ||||
Ans. A weak reference is a reference that gets removed on the next garbage collection cycle. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  weak reference  garbage collection Asked in 1 Companies   rare | ||||
| ||||
This question was recently asked at 'American International Group (AIG)'.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  applet Asked in 1 Companies basic   rare | ||||
| ||||
Ans. ConcurrentHashMap uses multiple buckets to store Data and hence avoid read locks which facilitates better performance. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  ashTabl expert   rare | ||||
| ||||
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  static class  inner classes   nested classes Expert   rare | ||||
| ||||
Ans. String is widely used as parameter for many java classes, e.g. network connection, opening files, etc. Making it mutable might possess threats due to interception by the other code segment or hacker over internet. Once a String constant is created in Java , it stays in string constant pool until garbage collected and hence stays there much longer than what's needed. Any unauthorized access to string Pool pose a threat of exposing these values. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Security  String pool   string immutable  immutability expert   rare | ||||
| ||||
This question was recently asked at 'GGK 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  marker interfaces  interfaces Asked in 1 Companies expert   rare | ||||
| ||||
Ans. Exception wrapping is wrapping an exception object within another exception object and then throwing the outer exception. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  exception handling  exception wrapping  exceptions intermediate   rare | ||||
| ||||
Ans. First will not create physical file in storage whereas the second will. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  file handling  File.createTempFile  file handling intermediate   rare | ||||
| ||||
Ans. String Pool resides in runtime constant Pool which is a part of Heap memory segment. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  string pool  memory management Expert   rare | ||||
| ||||
Ans. It uses those low order bytes of the result that can fit into the size of the type allowed by the operation. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  integer  data types Asked in 1 Companies   rare | ||||
| ||||
Ans. No, Java doesn't have a sizeOf operator. In C / C++ , its required to determine how much memory allocation is required which is not the case with Java. Java handles memory allocation and deallocation intrinsically. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  sizeOf  size of object  sizeOf operator Asked in 1 Companies   rare | ||||
| ||||
Ans. It's weird that compiler doesn't complain if we declare transient with static variable because it makes no sense. At least a warning message saying "transient is useless in this situation" would have helped with code cleaning. Static variables are never serialized and transient is an indication that the specified variable shouldn't be serialized so its kind of double enforcement not to serialize. It could be that as it makes no different to the variable behavior and hence using both keywords with a variable are permitted. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  static  transient  serialization Asked in 1 Companies expert   rare | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. Everytime an object is serialized the java serialization mechanism automatically computes a hash value by passing the meta information for the class. This id is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  serialVersionUID  serialization Asked in 3 Companies expert   rare | ||||
| ||||
Ans. Yes, That is possible class A { public static void main(String args[]){ if(System.out.printf("Hello World")==null){} } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Hello World  Hello world without ; Asked in 2 Companies   rare | ||||
| ||||
Ans. public void checkIfAnagram(String str1,String str2){ boolean anagram = true; for(char c:str1.toCharArray()){ if(!str2.contains(String.valueOf(c))){ System.out.println("Strings are Anagrams"); anagram = false; } if(anagram == true){ System.out.println("Strings are not Anagrams"); } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   check if 2 strings are Anagrams Asked in 30 Companies basic   frequent | ||||
| ||||
Ans. http://stackoverflow.com/a/6548203/2789764 | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  exception handling  exception expert   rare | ||||
| ||||
Ans. Using Runtime object. Runtime runtime = Runtime.getRuntime(); runtime.totalMemory(); runtime.freeMemory(); | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  jvm  memory management   rare | ||||
| ||||
Ans. No | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve     rare | ||||
| ||||
Ans. There is a Java system property "sun.arch.data.model" that can tell if JVM is 32 bit of 64 bit System.getProperty("sun.arch.data.model") can be used to get that property. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  jvm intermediate   rare | ||||
Usually asked with Questions related to Generics. | ||||
| ||||
Ans. Type erasure applies to the use of generics. When generics are used, they're pre compiled into compile time checks and execution-time casts. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  type erasures  generics Asked in 2 Companies intermediate   rare | ||||
| ||||
Ans. The external tables feature is a complement to existing SQL Loader functionality. It enables to access data in external sources as if it were in a table in the database. We have used it few times for replicating tables across different database systems. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  external table oracle Asked in 1 Companies   rare | ||||
| ||||
Ans. As with all other objects its garbage collected after its usage unless its rethrown. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  exceptions  exception handling   rare | ||||