Company Name - Accolite Bangalore
Date - 25 - 9 - 2017
Round - 1st Telephonic, questions are mostly in Java
Questions -
1. Internal working of HashMap
2. Cycle detection in LinkedList(Floyd algo)
3. Overriding Static methods in Java - no overriding in static methods, will be called as per object ref.
4. Overridign methods in java - derived method will hide base methods
5. Overriding variables in java - Not possible we simple get base variable
Examples -
class Parent{ int x, void method() { }}
class Child extends Parent { int y, void method(){ }}
Parent p = new child();
sysout(p.x) // ok
sysout(p.y) // CE
sysout(p.method()) // method in derived class
imagin method in decleared static in base or child any - Now its not overridden
p.staticmethod() // calls to parent class method since object decleared as parent class
6. Public Static Void main(String [] arg)
6. What if you change public and static place - No problem
7. What if you change return type of main method(it will be overloaded, give us RE- Main method not found)
8. try , catch , finally - remember finally always get called)
9. immutable classes
10. clone method (deep and shallow copy)
11. Two way hashmap design
Date - 25 - 9 - 2017
Round - 1st Telephonic, questions are mostly in Java
Questions -
1. Internal working of HashMap
2. Cycle detection in LinkedList(Floyd algo)
3. Overriding Static methods in Java - no overriding in static methods, will be called as per object ref.
4. Overridign methods in java - derived method will hide base methods
5. Overriding variables in java - Not possible we simple get base variable
Examples -
class Parent{ int x, void method() { }}
class Child extends Parent { int y, void method(){ }}
Parent p = new child();
sysout(p.x) // ok
sysout(p.y) // CE
sysout(p.method()) // method in derived class
imagin method in decleared static in base or child any - Now its not overridden
p.staticmethod() // calls to parent class method since object decleared as parent class
6. Public Static Void main(String [] arg)
6. What if you change public and static place - No problem
7. What if you change return type of main method(it will be overloaded, give us RE- Main method not found)
8. try , catch , finally - remember finally always get called)
9. immutable classes
10. clone method (deep and shallow copy)
11. Two way hashmap design
No comments:
Post a Comment