Question { 14622 }
Hi Friends, can u give me Real Time example for interface
and abstract class.(With Banking Example)
Answer
| Is This Answer Correct ? | 13 Yes | 2 No |
Question { Infinite Computer Solutions, 13140 }
What will happen inside init() in servlet. my interviewer
asked servlet lifecycle. i said "once servlet is loaded in
to memory init() will be called which performs servlet
initialization " . Again interview asked what values will be
initialized . what is difference between init() and
init(ServletConfig config).
Answer
| Is This Answer Correct ? | 8 Yes | 1 No |
Question { 26743 }
What is difference between abstract class & final class
Answer
| Is This Answer Correct ? | 29 Yes | 3 No |
Given:
1. package test;
2.
3. class Target {
4. public String name = “hello”;
5. }
What can directly access and change the value of the
variable name?
1 any class
2 only the Target class
3 any class in the test package
4 any class that extends Target
Answer
| Is This Answer Correct ? | 17 Yes | 0 No |
Question { 15788 }
could you run the java program without main method?
Answer
| Is This Answer Correct ? | 36 Yes | 8 No |
Question { 7587 }
"we cannot create an object of interface but we can create
a variable of it".diacuss the statement with the help of
an example.
Answer
| Is This Answer Correct ? | 11 Yes | 0 No |
java.lang.ClassNotFoundException:oracle.jdbc.driver.OracleDr
iver? I get this error at run time.I used oracle10G. I set
CLASS PATH:C:\oraclexe\app\oracle\product\10.2.0
\server\jdbc\lib\ojdbc14.jar;
I write JDBC PROGRAM like
import java.sql.*;
class Example
{
public static void main(String args[])
{
try
{
Class.forName
("oracle.jdbc.driver.OracleDriver");
System.out.println("Driver Loaded");
Connection con=DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:xe","system","salmas");
System.out.println("Driver Connected");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from
emp");
while(rs.next())
{
System.out.println(rs.getInt(1));
System.out.println(rs.getString(2));
System.out.println(rs.getString(3));
}
st.close();
con.close();
}
catch(Exception e)
{
System.out.println(e);
}
finally
{
System.out.println("it's
finally block executed");
}
}
}
Answer
| Is This Answer Correct ? | 2 Yes | 0 No |
Question { 5376 }
please send code example of inner classes?
Answer
| Is This Answer Correct ? | 6 Yes | 1 No |
Question { 8847 }
what is object deep copy and shallow copy and why it is
required?
Answer
| Is This Answer Correct ? | 7 Yes | 0 No |
Question { 23081 }
what is the use of Clonable,and serializable interface?
Answer
| Is This Answer Correct ? | 48 Yes | 5 No |
Question { 23863 }
servlet has not any main method in it how does it work by
JVM?
Answer
| Is This Answer Correct ? | 3 Yes | 5 No |
Question { 7414 }
all are saying java doesn't support multiple inheritance but
by default Object class is super class for all the user
defined classes and we can extend atmost one class so each
class can extend more than one class so java supports
multiple inheritance?i am confused with this,pls any one
explain me.
Answer
| Is This Answer Correct ? | 13 Yes | 0 No |
Question { 5751 }
what is class.forname() and how it will be useful ?
Answer
| Is This Answer Correct ? | 5 Yes | 0 No |
Question { 13628 }
what is the difference between String s="hello"; and String
s=new String("hello");?
Answer
| Is This Answer Correct ? | 3 Yes | 2 No |
Question { 7734 }
why the sleep method does not leave the lock and wait method
leave the lock
Answer
| Is This Answer Correct ? | 0 Yes | 2 No |