| Other Core Java Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is meant by packages? | | 2 |
| Given:
10. interface A { void x(); }
11. class B implements A { public void x() { } public
voidy() { } }
12. class C extends B { public void x() {} }
And:
20. java.util.List list = new java.util.ArrayList();
21. list.add(new B());
22. list.add(new C());
23. for (A a:list) {
24. a.x();
25. a.y();;
26. }
What is the result?
1 Compilation fails because of an error in
line 25.
2 The code runs with no output.
3 An exception is thrown at runtime.
4 Compilation fails because of an error in
line 20.
| | 1 |
| When does Exception occurs? | | 3 |
| How a class can implement an interface? | SysArc | 4 |
| Can we place the any object to key attribute of
HashMap<key,value>? | HCL | 3 |
| Which method is used to find that the object is exited or
not? | | 1 |
| What is emant by API?
is it related to java only or it is common for all OOPS
supporting language? | | 2 |
| why interfaces are faster than abstract classes? | | 2 |
| what is the difference between Cpp And Java | Infosys | 7 |
| What is the default initialized value of String type
variable? | | 3 |
| Package1 and Package2 both have a method name lets say
"methodA" with different implementation. When I import both
the packages in a java class how can I use both the methods? | Ericsson | 3 |
| How to convert a string to long? | | 2 |
| what is life cycle of applet? | | 4 |
| Name the types of 'priority'? | | 2 |
| How will you convert an ArrayList to Arrays? | KPIT | 3 |
| How to call a Stored Procedure from JDBC? | Satyam | 2 |
| What are the latest versions in JAVA related areas? | Netcraft | 2 |
| what ide u r using and wat version, how wil u build the
project etc ? | | 2 |
| Marker interface means , interface which has no methods.Then
what is the necessity of its usage.I read "it tells the
compiler that it should be treated differently ". "It is
used to store state of an object". But still am not
clear.Please explain clearly. | | 1 |
| What JNDI(Java Naming and Directory Interface) provides? | | 4 |
| |
| For more Core Java Interview Questions Click Here |