CTS java interview
Home Question&Answers Revision Notes Resources Interview Tips Interview Samples

Valid HTML 4.01 Transitional

CTS JAVA INTERVIEW
Company CTS
Mode Direct
Duration 30+ minutes
Contributed By Meghana
Candidate's Profile 3+ Years of Exp in Java and J2EE







Question : Can you tell me more about your current roles and responsibilties.
Answer : My role is that of a senior software engineer. Most part of job responsibilities involves coding and related actvities.

Question : What is Encapsulation? How do you acheive encapsulation in java?
Answer :

Question : What is Overriding?
Answer : Only methods can be overridden. Overriding is used to provide a different method behavior in the subclass.

Question : public class A{
int add(int a,int b){
}
float add (int a,int b){
}
}
Will this compile?
Answer : No. It will give compile time error because of duplicate method declaration. Just changing the return type doesn't mean they are two different methods.

Question : public class A{
try{
......
}
catch(ArithimeticException e)
{
e.printstacktrace();
}
catch(Exception e)
{
e.printstacktrace();
}
Will this work?
Answer : It will work fine.

Question : Are you sure?
Answer : Yes. Because ArithmeticException is a subclass of Exception and it is stated above Exception block so it will work fine. Though it is not advisable to explicitly catch runtime exceptions like ArithmeticException.

Question : public class A{
try{
getconnection();
System.exit();
}
catch(Exception e){
e.printstacktrace();
}
finally{
con.close();
}
Will the connection get closed in the finally block?
Answer : System.exit() method after the getConnection() method will terminate the JVM, hence finally block will not get a chance to execute. So the connection will not be closed.

Question : Have you worked on threads? How do you implement thread?
Answer : There are 2 ways to implement threads. One is by directly extending the Thread class and the other is by implementing the runnable interface. In both the cases, run() method has to be implemented

Question : Which one is better ?
Answer : Implementing the Runnable interface provides us the flexibility to extend some other class. So it's always better to use Runnable interface for implementing Threads.

Question : What is synchronization?
Answer : Synchronization is a process of restricting an object access to only one thread at any point of time .

Question : Can you name few classes which are synchronized in java.util package?
Answer : Vector, Hashtable, HashSet

Question : Explain servlet life cycle?
Answer :

Question : If we explicitly call init method of a servlet from another java class, will it create different servlet instances?
Answer :

Question : What is Serialization?
Answer :

Question : Explain Entity bean life cycle?
Answer :

Question : What are the differences between CMP and BMP?
Answer :

Question : How do u specify whether it is a CMP or BMP?
Answer : We will mention using bean type parameter in deployment descriptor.

Question : How do u manage pool of connections say 100 or 150?
Answer :

Question : Which Database are u using?
Answer : Oracle

Question : What is right outer join?
Answer :

Question : two tables he has given
Answer : select name from t1,t2 where t1.id=t2.id(+) o/p select name from t1,t2 where t1.id(+)=t2.id o/p

Question : What is a self join?
Answer :

Question : What is the difference between stored procedures and functions?
Answer :

Question : Explain the architecture of your current project?
Answer : explained...

Question : Have you worked on Design Patterns?
Answer : I have worked on few.

Question : What is a Singleton pattern?
Answer :

Question : Explained Session Facade pattern?
Answer :

Question : Who is your role model?
Answer :

Question : What do you like and dislike about yourself?
Answer :


If you wish to share your interview experience, send us the entire interview questions with answers to j2eeguide@yahoo.com. The questions should be in the same order as it was asked in the interview. We will review your interview stream for originality and correctness, after which the stream will be uploaded.

java j2ee interview guide IF YOUR INTERVIEW SUBMISSION IS SELECTED, YOU WILL RECEIVE A PRINTED COPY OF "Java J2EE Interview Guide" ABSOLUTELY FREE!!!.

Rules
  • This offer is available only for contributors from India.
  • Java J2EE Interview Guide consists of the entire material hosted at JGuide.org.
  • The content sent by the contributor becomes the property of JGuide.org.
  • Shipping charges will be borne by JGuide.org
  • This offer can be withdrawn without any prior notice.
  • The decision of the JGuide team will be final.




    Pls send your questions, suggestions and feedback to j2eeguide@yahoo.com

    © Copyright JGuide 2006, All Rights Reserved.