Java ee - Interview Questions and Answers for 'Abs' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Interview Questions


 2679 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Java ee - Interview Questions and Answers for 'Abs' - 12 question(s) found - Order By Newest

 Q1. Write a program to show thread usage in Java by implementing runnable interface2017-08-03 12:16:07

Ans. public class MyClass {
   static class MyThreadClass implements Runnable{

      public void start() {
         Thread t = new Thread(this,"threadName");
         t.start();
      }
      
      @Override
      public void run() {
         System.out.println("Hello");
         try {
            Thread.sleep(1000);
            System.out.println("Hello Again");
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
         
      }
      
   }
   
   public static void main(String[] args){
      MyThreadClass myThreadClass = new MyThreadClass();
      myThreadClass.start();
      
      MyThreadClass myThreadClass2 = new MyThreadClass();
      myThreadClass2.start();
   }
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Threads  runnable interface


  Q2. What is a cookie ?Java EE
admin
info@buggybread.com
Ans. A cookie is a small piece of text stored on a user's computer by the browser for a specific domain. Commonly used for authentication, storing site preferences, and server session identification.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     cookie   javascript   web application   session management   browser   j2ee     Wayfair  OpenBet  Akamai  Alicen  HCL Technologies  Tata Consultancy (TCS)  Wipro  Infosys  Mindtree  Global Logic  Accenture  Lexis Nexis  Elsevier  Vyom Labs  SVV Geotech      basic        frequent


 Q3. Write a Program to swap 2 variables ( using 3rd variable )Core Java2017-07-25 19:41:20

Ans. int x = 1;
int y = 2;
int z = x;
x = y;
y = z;

System.out.println("x="+x);
System.out.println("y="+y);

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     swap 2 variables  code  coding     Real come info      basic


 Q4. Write a Program to swap two variables ( without using 3rd variable )2017-07-25 19:42:32

Ans.
int x = 1;
int y = 2;

x = x+y;
y = x-y;
x = x-y;

System.out.println("x="+x);
System.out.println("y="+y);

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     swap 2 variables


 Q5. Which method needs to be implemented if a class is implementing comparable interface ?Core Java
a. comp
b. compare
c. compareTo
d. compareEquals

Ans.c. compareTo

 Q6. What is Dirty Read in Database Transactions ?Database
a. Data Read by Transaction 2 which hasn't yet updated by Transaction 1
b. Data Read by Transaction 2 which has been updated and commited by Transaction 1
c. Data Read by Transaction 2 which has been updated but not commited by Transaction 1
d. Inability of Transaction 2 to read Data when Transaction 1 is updating.

Ans.c. Data Read by Transaction 2 which has been updated but not commited by Transaction 1

 Q7. Which of the following is not true for abstract classes ?Core Java
a. Abstract Class is only meant to be sub classed and not supposed to be instantiated.
b. Abstract class handlers can be used to handle derived class objects.
c. We can't have an abstract class without abstract methods.
d. Abstract class has member elements.

Ans.c. We can't have an abstract class without abstract methods.

 Q8. Which of the following class creates immutable objects ?Core Java
a. String
b. StringBuffer
c. StringBuilder
d. None of these create immutable objects.

Ans.a. String

 Q9. Which of the following can be declared abstract ?Core Java
a. static methods
b. instance methods
c. static variable
d. instance variables

Ans.b. instance methods

 Q10. In majority of the cases, the following join will give maximum number of results ?Database
a. Inner Join
b. Outer Join
c. Left Join
d. Right Join

Ans.b. Outer Join

 Q11. Which if the following is true for SQL Joins ?Database
a. Left Join and Right Join gives equal number of Results
b. Outer Join and Inner Join gives equal number of Results
c. Inner Join gives maximum number of results records
d. Inner Join gives minimum number of result records

Ans.d. Inner Join gives minimum number of result records

 Q12. Which of the following is not true for Prepared Statements ?Database
a. Prepared Statements provides better performance
b. Prepared Statements prevent SQL Injection attacks
c. Prepared Statements provide ORM capabilities
d. Prepared Statement provides DB side caching

Ans.c. Prepared Statements provide ORM capabilities



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: