Java Basics
|
2. [Exception]Two major subclasses under class Exception?[P.4 #1][OpenX]
3. [Exception]When will you use the keyword "throw" in java?[P.4#3][OpenX]
4. [GC] how to do the garbage collection [India#2][OpenX]
6. [Feature] difference between constructor and method[P.9#2][OpenX]
7. [OS] Explain deadlock[OpenX]
7. [OS] Explain deadlock[OpenX]
7. [MVC] Explain MVC[OpenX]
9. [Algorithm] Explain recursion[OpenX]
10. [C] C arrays declared and allocated[OpenX]
11. [Collection] Difference between ArrayList and Vector
13. [OOP]Procedural or Object-Oriented[Google]
14. [OOP]Polymorphism and its advantage[Google]
15. [AM] public, protect, private, default[Google]
16. [AM] private mechanism[Google]
17. [Data Structure] list,set,...[OpenX]
1. [String] Two major differences between StringBuffer and StringBuilder? [P.3 #7][OpenX]
StringBuffer
|
-Thread safety
|
StringBuilder
|
-Faster
|
2. [Exception]Two major subclasses under class Exception?[P.4 #1][OpenX]
IOException
|
checked exception:
-user error or a problem cannot be foreseen,
-for example, file cannot be found.
-cannot simply be ignored at the time of compilation [P.3#12]
|
RuntimeException
|
runtime exception:
- could have been avoided
- can be ignored at the time of compilation [P.3 #13]
|
3. [Exception]When will you use the keyword "throw" in java?[P.4#3][OpenX]
throw
(I)
|
By using the throw keyword, a exception can be thrown, either a newly instantiated one or an exception that you just caught.
Ex.
if (prerequisites == null )
{
throw new IlleagalArgumentException("illegal prerequisites array");
} |
throws
(System)
|
By using the throws keyword, a method declare a checked exception. The throws keyword appears at the end of a method’s signature.[P.4 #2]
|
4. [GC] how to do the garbage collection [India#2][OpenX]
1.How
2. What
3. How inner
Reference
|
6. [Feature] difference between constructor and method[P.9#2][OpenX]
Constructor
|
-same name as the class
-no return value
-are only called once
- use new keyword to invoke
|
Method
|
-different name
- can return any value or void
- are called many times
- use dot operator to invoke
|
7. [OS] Explain deadlock[OpenX]
Deadlock Conditions
Two process sharing the same resource and resource is only accessed by one process at a time 1. one is waiting another 4.
->
| |
<-
Deadlock Prevention
A Simple Java Thread
two ways in which thread can be created:
Reference: 150 Cracking code
Reference:
https://courses.engr.illinois.edu/cs241/sp2012/lectures/28-deadlock-solutions.pdf http://www.cs.jhu.edu/~yairamir/cs418/os4/tsld011.htm |
8. [MVC] Explain MVC[OpenX]
MVC
Model View Controller is a design pattern it decouples data access logic from business logic.
References:
|
9. [Algorithm] Explain recursion[OpenX]
Recursion
Reference:
150 Cracking code
http://www.programmerinterview.com/index.php/recursion/explanation-of-recursion/
|
10. [C] C arrays declared and allocated[OpenX]
11. [Collection] Difference between ArrayList and Vector
12.[OOP] Inheritance and its advantage[Google]
13. [OOP]Procedural or Object-Oriented[Google]
14. [OOP]Polymorphism and its advantage[Google]
15. [AM] public, protect, private, default[Google]
16. [AM] private mechanism[Google]
27. Difference between String ,StringBuilder and StringBuffer Classed?
28. Constructor: Overloading ,Examples, Basics, Rules ,Important Points?
29. What are inner Classes and its types(Regular method local, anonymous)?
1. Java pass by value or pass by reference
C Array Declared and Allocated
Reference:
|
11. [Collection] Difference between ArrayList and Vector
ArrayList
|
1.Not Synchronized: multiple thread can work in ArrayList at the same time.
-Structural modifications means addition or deletion of elements from the list.
-Setting the value of an existing element is not a structural modification.
2.Data growth 1.5X
- SAME: hold onto their content using an array
- SAME: dynamically expand the size of array if run out of room
3. Performance: better
4. Fail-fast: The iterator will throw concurrentModificationException
if the collection gets structurally modified by any means, except the add or remove methods of iterator, after creation of iterator
|
Vector
|
1.Synchronized: (thread safe) only one operation at a time add or delete
2.Data Growth 2X
- SAME: hold onto their content using an array
- SAME: dynamically expand the size of array if run out of room
- Avector defaults doubling the size of its array, while ArrayList increases its array size by 50 percent.
3. Performance: worser due to thread lock
4. Not Fail-fast:
|
SIMILARITIES
|
1. growable array data structure
2. The iterator and listiterator returned by these classes are fail-fast
3. both maintain the elements insertion order and are ordered collection classes
4. both allows duplicate and null values
5. grows and shrinks automatically when overflow and deletion happens
|
make ArrayList sunchronized
|
// use Collections.synchronizedList method
List list = Collections.synchronizedList(new ArrayList());
….
// if you wanna use iterator on the synchronized list, use it
// like this. It should be in synchronized block
synchronized(list)
{
Iterator itr = list.iterator();
while( iterator.hasNext() )
{
...
itr.next();
...
}
}
|
Reference
|
http://beginnersbook.com/2013/12/difference-between-arraylist-and-vector-in-java/
|
12.[OOP] Inheritance and its advantage[Google]
13. [OOP]Procedural or Object-Oriented[Google]
14. [OOP]Polymorphism and its advantage[Google]
15. [AM] public, protect, private, default[Google]
class
|
package
(package com.xxx
|
subclass
(extends “Class Name”)
|
other package
(import com.xxx.”ClassName”)
|
can modify class ?
| |
public
|
O
|
O
|
O
|
O
|
O class name same as file name
|
protect
|
O
|
O
|
O
|
X
|
X
|
default
|
O
|
O
|
X
|
X
|
O class name same as file name
|
private
|
O
|
X
|
X
|
X
|
X
|
17. [Data Structure] list,set,...[OpenX]
Java Advanced
|
1. Java pass by value or pass by reference[Google]
2. How LinkedHashMap works[Google]
3. How HashMap works
4. How TreeMap works
5. Factory pattern[Google]
5. Factory pattern[Google]
6. Singleton[Google]
7. Java: Why does my compiler warn me about overriding equals() in my class without overriding hashCode()?[Google]
8. Static keyword
8. Static keyword
9. Final keyword
10. error condition for writing stored procedure or accessing stored procedure?
11. difference between Executor.submit() and Executer.execute() method?
12. write code for iterating over hashmap?
13. synchronize critical section of getInstance() method or whole getInstance() method?
14. Difference between creating string using String new() and String literal?
15. Overriding hashCode() method has any performance implication
16. What's wrong using HashMap in multi-threading environment? When get() method go to infinite loop?
17. Thread-safety ? Why is it required? How to achieve it?
18. What will happen to call return statement or System.exit on try or catch block? will finally block execute?
19. Can you override private or static method in Java?
20. What will happen to put a key object in a HahMap which is already there?
21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?
22. What is the issue with following implementation of CompareTo() method?
23. How do you ensure that N thread can access N resourced without deadlock?
24. Difference between CyclicBarrier and CountDownLatch in Java?
25. Can you access non static variable in static context?
26. Difference between Comparable and Comparator Itnerface?20. What will happen to put a key object in a HahMap which is already there?
21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?
22. What is the issue with following implementation of CompareTo() method?
23. How do you ensure that N thread can access N resourced without deadlock?
24. Difference between CyclicBarrier and CountDownLatch in Java?
25. Can you access non static variable in static context?
27. Difference between String ,StringBuilder and StringBuffer Classed?
28. Constructor: Overloading ,Examples, Basics, Rules ,Important Points?
29. What are inner Classes and its types(Regular method local, anonymous)?
1. Java pass by value or pass by reference
Java is ALWAYS pass-by-value (meaning make another new copy ).
That’s why when we change object’s value within function, the original object’s value is untouchable.
Reference:
|
2. How LinkedHashMap works
4. How TreeMap works
HashSet uses HashMap object internally to store its elements whereas LinkedHashSet uses LinkedHashMap object internally to store and process its elements.
boolean dummy value is just to differentiate this constructor from other constructors of HashSet class which take initial capacity and load factor as their arguments.
HashSet(int initialCapacity, float loadFactor, boolean dummy)
{
map = new LinkedHashMap<>(initialCapacity, loadFactor);
}
All method is inherited from its super class - HashSet. So all operations work in the same manner as that of HashSet. The only change is the internal object used to store elements.
In HashSet, elements you insert are stored as keys of LinkedHashMap object.
The values of these keys will be the same constant i.e., “PRESENT”
How LinkedHashSet Maintains Insertion Order?
The elements you insert in the LinkedHashSet are stored as keys of this LinkedHashMap object.
Each key, value pair in the LinkedHashMap are instances of its static inner class Entry<K,V>
This Entry<K,V> extends HashMap.Entry class.
The insertion order of elements into LinkedHashMap are maintained by adding two new fields to this class. They are before and after.
These two fields hold the reference to previous and next elements. These two fields make LinkedHashMap to function as a doubly linked list.
Reference:
|
3.How HashMap works
-HashMap works on the principle of Hashing.
-Hash Function: int hashCode()
-Hash Value: the int value returned by the hash function
-Bucket: store key value pairs. It can be multiple and use simple linked list to store objects
Get(Object key)
STEP1: hashCode hash hashValue
STEP2: equals()
hash(key.hashCode()) : to find a bucket location (backing array) where keys and values are stored in form of a nested class called Entry(Map.Entry).
Is that only value stored in the bucket?
Answer: No. Both key and value is stored in the bucket as a form of Entry object.
call get(Key k) method on the HashMap object
if key is null, then Null keys always map to hash 0, thus index 0
Why we are calculating the hash value again using hash(hashValue)?
Answer: it depends against poor quality hash functions.
Answer: Entry object stores in the bucket like this (hash,key,value,bucket index)
What if when two different keys have the same hashcode ?
Solution: equals() method comes to rescue.
Answer: The bucket is the linked list effectively. It’s not a LinkedList as in a java.util.LinkedList - it’s a separate (simpler ) implementation just for the map
Answer: So we traverse through linked list, comparing keys in each entries using keys.equals() until it return true. Then the corresponding entry object Value is returned.
When the function ‘equals’ traverses through the linked list does it traverses from the start to end one by one ….. Or the linked list is sorted based on key and then it traverses?
Answer: the end is found and the element is added or the key is matched and the value is returned
What if when two keys are same and have the same hashcode?
Answer: if key needs to be inserted and already inserted hashkey’s hashcode are same, and keys are also same (via reference or using equals() method) then override the previous key value pair with the current value pair.
Any class(String etc.) can serve as a key if and only if it overrides the equals() and hashCode() method.
How will you measure the performance of HashMap?
Answer: two parameters affect its performance: initial capacity and load factor
The capacity is the number of buckets in the hashtable (hashMap class is rougly equivalent to HashTable, except that it is unsynchronized and permits null), and the initial capacity is simply the capacity at the time the hash table is created.
The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased. When overflow the number of entries exceed the product of the load factor and the current capacity, the hash table is rehashed , twice the number of buckets.
What is the time complexity of HashMap get() and put()?
Both O(1), assume the hash function disperses the elements properly among the buckets.
What is the difference between HashMap and ConcurrentHashMap?
Answer: the later is thread-safe
Map<String,String> syncMap = Collections.synchronizedMap(map)
Reference:
|
4. How TreeMap works
-sort the key in ascending order
-log(n) containsKey, get, put and remove
- red-black tree based NavigableMap implementation
Rotations maintains the inorder ordering of the keys (x,y,z)
A rotation can be maintained in O(1) time.
Why and when we use TreeMap?
Answer: get the sorted list of keys in ascending order.
What is the runtime performance of the get() method in TreeMap and HashMap, where n represents the number of elements?
Answer: log(n) for all operations in TreeMap , HashMap is O(1) assume hash function disperses elements properly among the buckets.
What is “natural ordering ” in TreeMap?
Answer: “Natural” ordering is the ordering implied by the implementation of the Comparable interface by the objects used as keys in the TreeMap. Essentially, RBTree must be able to tell which key is smaller than the other key, and there are two ways to supply that logic to the RBTree implementation:
Natural ordering is the order provided by the Comparable interface. If somebody puts the key that do not implement natural order then it will throw ClassCastException.
*Why do we need TreeMap when we have sortedMap?
sortedMap is a interface and TreeMap is the class implementing it. As we know one can not create objects of the interface. Interface tells us which methods a sortedMap implementation should provide. TreeMap is such an implementation.
Which data structure you will prefer in your code : HashMap or TreeMap?
HashMap is faster, just insert and retrieve, then HashMap
Alphabetically sorted, TreeMap
What happens if the TreeMap is concurrently modified while iterating the elements
The iterator fails fast and quickly if structurally modified at any time after iterator is created (in any way except through the iterator’s own remove method.)
*Which copy technique (deep or shallow) is used by the TreeMap clone() method?
clone() return the shallow copy of the TreeMap instance. In shallow copy Obejct A points to Object B location in memory. In other words, both Object A and B sharing the same elements. The keys and values themselves are not cloned.
*why java’s treeMap does not allow an initial size?
HashMap reallocates its internals as the new one gets inserted
while TreeMap does not reallocate nodes on adding new ones. Thus,
the size of the TreeMap dynamically increases if needed, without shuffling the internals.
So it is meaningless to set the initial size of the TreeMap.
Reference:
http://javahungry.blogspot.com/2014/06/how-treemap-works-ten-treemap-java-interview-questions.html
|
5. Factory pattern
Rerence:
|
6. Singleton
1.What only one instance of whole application
It is the most used design pattern in web applications.
Singleton in Java is a class with just one instance in whole data java application and provides a getInstance() method to access the singleton instance .For example, java.lang.Runtime is a singleton class. Creating Singleton was tricky prior Java 4 but once java 5 introduced Enum its very easy.
2. How
write Java singleton using double checked locking. Remember to use volatile variable to make Singleton thread-safe.
-create a static variable
private stati JavaHungrySingleton uniqueInstance;
-declare the constructor private
private JavaHungrySingleton() {}
-getInstance()
-public static synchronized JavaHungrySingleton getInstance(){}
-if (uniqueInstance == null )
uniqueInstance = new JavaHungrySingleton();
return uniqueInstance;
Lazy initialization: Last moment to have an object. We create the object of the class only when it is about to use in the program code.
Early initialization: we create the object when the class is getting loaded into the JVM.
double checked locking: first we check if the object is created, if not then we create one using synchronized block.
Reference:
|
7. Java: Why does my compiler warn me about overriding equals() in my class without overriding hashCode()?
Q: When do you override hashcode and equals()?
Whenever necessary especially if you want to do equality check or want to use your object as key in HAshMap.
Q: What will be the problem if you don’t override hashcode() method?
You will not be able to recover your object from hashmap if that is used as key in HashMap
References:
|
8.[Java] static keyword
static class
anything you want to share between all objects can be made static e.g., singleton instance of a Singleton Class in Java
1.nested
2.utility class
|
-1. nested static class: can have an instance of nested class w/o any instance of outer class
2. when to use: utility class which are required by all components and which itself doesn’t have any state. a single resource to be shared between all instances
-there is only one copy of static variable will be present in Java heap memory
- cannot be applied to top level class
-bounded using static binding at compile time so they are comparatively faster than there non-static counter part which were bounded during runtime.
| |||||
static method
Disadvantage: not override, create bug in consurrent environment
E.g.,
java.util.Collections
java.lang.Math
BorderFactory
java.lang.Runtime
|
1.one for class (main())
2. access class variable w/o using object of class
3. cannot be overridden implicitly final, because overriding is done based on the type of object
4. so it can be shadowed(since cannot be overriden) by another static method in subclass, “method hiding”
5. Most utility methods are declared as static method
-being direct accessed in static or non-static method
-access non-static method or variable using object of class
| |||||
static variable
|
1. shared common for all the objects
2. can be accessed or altered by any object
3. multi-threading environment, access to static variable must be synchronized.
4. static belong to class
5. non-static belong to object
6. memory allocation(initialized) only happen once when class load in the memory
-being accessed directly in static and non-static block
- non-static variable can be accessed by using object of class
| |||||
static block
|
1.holds piece of code to be executed when class is loaded in Java
static
{
String category =”ee cs”;
System.out.println(“example of static block in java”);
}
throw exception like java.lang.NoClassDefFoundError when class failed to load
| |||||
Reference
|
9. Final keyword
Final
|
-along with static to make static final constant
-raise compilation error if you try to re-initialized final variables in java
-improves performance
-multi-threading environment without any additional synchronization overhead.
- immutable class, cannot be modified like String, read-only
-!= finally keyword in Exception handling
-!=finalize() keyword declared and called before an object is garbage collected by JVM
- All variables declared inside java Interface are implicitly final
-Final and abstract are two opposite keyword
|
Final class
|
-is complete in nature
-cannot be subclassed or inherited
-String, Integer, Double and other wrapper classes
|
Final method
|
-cannot be overriden in sub-class
-it’s complete and its behavior should remain constant in sub-class
-faster because they are not required to be revised during run-time and they are bounded on compile time
|
Final variable
|
-constant
-must be initialized during declaration or in constructor either explicitly or by calling this()
|
Reference
|
10. error condition for writing stored procedure or accessing stored procedure?
**stored procedure
|
-Is a set of statement/commands which reside in the database.
-The stored procedure is precompiled.
-Each database has its own stored procedure language
|
-stored procedure should return error code if some operation fails
-but if stored procedure itself fail then catching SQLException is only choice
| |
Reference:
|
11. difference between Executor.submit() and Executor.execute() method?
*Executor.submit()
|
- exception submit with submit
-any thrown exception, checked exception or not, is then part of the task return’s status
-the future.get will re-throw this exception, wrapped in an ExecutionException
|
*Executor.execute()
|
-exception submit with execute
-this exception will go to uncaught exception handler (print the stack trace toSystem.err)
|
12. write code for iterating over hashmap?
using while and for loop
for (Entry<K,V> entry: map.entrySet() )
{
}
for ( K key:map.keySet() ){ } for ( V vlaue: map.vlaueSet() ) { } |
13. synchronize critical section of getInstance() method or whole getInstance() method?
Answer is critical section because if we lock whole method than every time someone call this method will have to wait even though we are not creating any object
|
14. Difference between creating string using String new() and String literal?
new()
|
-created in heap
-not added in the string pool
|
literal
|
-created in String pool
-String pool exist in Perm area of heap
|
15. Overriding hashCode() method has any performance implication
poor hashCode() function will result in frequent collision in HashMap which eventually increase time for adding an object into HashMap
|
16. What's wrong using HashMap in multi-threading environment? When get() method go to infinite loop?
during concurrent access and re-sizing
|
17. Thread-safety ? Why is it required? How to achieve it?
-A real barrier invalidated the local memory (cache, registers, etc) and read the contents from the main memory, so changes made by other threads becomes visible to current thread
-A write barrier flushed out the contents of the processor’s local memory to the main memory, so that changes made by current Thread becomes visible to the other threads.
| |
Method1 - synchronized
|
-when a thread acquires monitor of an object, by entering into a synchronized block of code, it performs a read barrier (invalidates the local memory and read from the heap instead)
-Similarly, exiting from a synchronized block as part of releasing the associated monitor, it performs a write barrier(flushes changes to the main memory)
|
Method 2 -volatile
|
-read and write to volatile variables have same memory semantics as that of acquiring and releasing a monitor using synchronized code block.
- When Thread A writes to a variable V, and afterwards Thread B reads from variable V, any variable that were visible to A at the time V was written are guaranteed now to be visible to B.
Data data = null;
volatile boolean flag = false;
ThreadA
---------------
data = new Data();
flag = true; // flush the data as well as flag to main memory
Thread B
----------------
if (flag)
{
use data;
}
|
Method 3- final
|
-multi-threading environment without any additional synchronization overhead.
- immutable class, cannot be modified like String, read-only
|
18. What will happen to call return statement or System.exit on try or catch block? will finally block execute?
return statement in try or catch
|
-not execute return and finally block will execute
|
System.exit in try or catch
|
-execute system.exit and finally block won’t run
|
19. Can you override private or static method in Java?
No, you cannot override private or static method in Java, if you create similar method with same return type and same method arguments that’s called method hiding.
|
20. What will happen to put a key object in a HashMap which is already there?
it will replace the old mapping because hashMap doesn’t allow duplicate keys
|
21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?
-overloading and overriding
-Answer is you can very well throw super class of RuntimeException in overriden method
- you cannot do same if it’s checked Exception
|
22. What is the issue with following implementation of CompareTo() method?
public int compareTo(Object o)
{
Employee emp = (Employee) emp;
return this.id - o.id;
}
|
23. How do you ensure that N thread can access N resourced without deadlock?
-deadlock and race conditions
-key point here is order, if you acquire resources in a particular order and release resources in reverse order you can prevent deadlock.
|
24. Difference between CyclicBarrier and CountDownLatch in Java?
*CyclicBarrier
|
-reuse even if Barrier is broken
|
*CountDownLatch
|
-cannot reuse
|
25. Can you access non static variable in static context?
NO, you cannot access non-static variable from static method.
Reason: those variables are not yet created. instance variable(non-static variable) has different value for each instances and they get created when instance of an object is created either using new() operator or using reflection like Class.newInstance().[static variable initialized when class is loaded into JVM]
Solution: use instance object of class to access it
access static variable in non static context.
Solution: YES you can. Imagine that this static variable will be the same for all instances of that class, so any instance can access it.
|
Reference:
|
26. Difference between Comparable and Comparator Interface?
Comparable
- Interface |
-public interface which is used to impose an natural ordering
-default sorting by ASCII values
-Collections.sort() and Arrays.sort()
-1. Sort sequence: only one
-2. Methods public int compareTo(Object o)
-3. Objects needed for Comparison: this
-4.Modify Classes:X
-5.Package:java.lang.package => provided by default
-use a key in a sortedmap like treeMap or clements in a sortedSet for example TreeSet, without specifying any Comparator
| |
Comparator -class
|
-a comparator function, which is used to impose ordering on some collection of bjects. To allow precisely control over sort order, Comparators can be passed to a sort method (e.g, Collections.sort())
- TreeSet or TreeMap can also be sorted using Comparator
-1. Sort sequence: many
-2.Methods used: public int compare (Object o1, Object o2)
-3.Objects needed for Comparison: two objects
-4. Modify Classes: O. has to modify the class whose instances you want to sort
-5.Package:java.util.package=>utility to sort objects
Reference:
|
27. Difference between String ,StringBuilder and StringBuffer Class?
String
|
StringBuffer
|
StringBuilder
| |
Storage Area
Modifiable
Thread Safe
Performance
|
Consistent String Poll
No(immutable)
Yes
Fast
|
Heap
Yes(Mutable)
Yes
Very slow
|
Heap
Yes(Mutable)
No
Fast
|
http://javahungry.blogspot.com/2013/06/difference-between-string-stringbuilder.html
|
28. Constructor: Overloading ,Examples, Basics, Rules ,Important Points? abstract class have at least one constructor
-create objects
1.name is the same as the name of the class
2. no return type
3. calls the constructor of the superclass first, which is also known as constructor chaining. Internally, an implicit super() has been made
4. can use any modifier private or public
5. no constructor(), compiler put one implicitly in the code
6. The default constructor is always no argument constructor
7. cannot make a call to instance method, or access in an instance variable, until after the super constructor runs.
8. Abstract classes always has constructor, and those constructors are called when a concrete subclass is instantiated.
9.interface do not have constructors
10. First line of constructor super() or this(), never both
11. Every class , even an abstract class have at least one constructor
12. Never inherited and cannot be overriden
13. Overloading a constructor => multiple version of constructor
Reference:
|
29. What are inner Classes and its types(Regular method local, anonymous)?
1. To create the instance of the inner class you need to have the instance of the outer class
2. Method local Inner Class
A method local inner class cannot use variables declared within the method
(including parameters) unless those variables are marked final
3. Anonymous Inner class
|
30. Difference between == and equals() method?
==, check references
|
equals(), check content
|
-only be true if two String point to the same underlying String object
String a = new String(“a”);
String b = new String(“a”);
a==b => false=> they are two different objects
Integer i = new Integer(10);
Integer j = new Ineger(10);
i==j => false=> they are two different objects
|
-compare two strings character by character to determine equality while “==” checks whether 2 string objects are identical
-faster than ( String.compareTo(String) == 0 ) , ==0 take extra cycle
String a = new String (“a”);
String b = new String(“a”);
a.equals(b) =>true
|
reference
|
http://javahungry.blogspot.com/2013/06/difference-between-equals-and-double-equals-method-with-example-java-collections-interview-question.html
|
31.http://javahungry.blogspot.com/2013/06/jdbc-interview-questions-in-java-top-15-core-java-technical-round.html
Very nice article . Thanks for sharing good tutorials. You can see treemap examples on java vogue
ReplyDelete