Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

interview questions  RSS feed

 
kesava chaitanya
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)Class A {
Public void amethod(){
System.out.println(�amethod�);
}
class B extends A{
public static void main(String args[]){
B b = new B();
b.amethod();
}
}
}
if I run amethod on the console;
in the class A if i replace public class with private modifier;then I don�t compile class B and I run directly what will happen?
What is late binding and early binding?
2)
If I don�t want to instantiate a class B; how will u call constructor directly in class?
Class B{
B(){
}
}
public static void main(String args[]) {
B b = new B();
}
3) Can interface extend class?IF NO WHY
4)Howmany ways of instantiating an object?
5)How do we achieve read-only functionality using array list
6)If Hashtable take unique values what about hash map? Will it throw exception?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!