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

# Search Interview Questions

2720 questions in repository.
There are more than 200 unanswered questions.
Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

Algorithm - 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 {

public void start() {
t.start();
}

@Override
public void run() {
System.out.println("Hello");
try {
System.out.println("Hello Again");
} catch (InterruptedException e) {
e.printStackTrace();
}

}

}

public static void main(String[] args){

}
}

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

Q2. Write program to create a linked list and perform different operations on it.Algorithm2017-02-24 14:18:01

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

Linkedlist  data structures  algorithm     Kony Labs      basic

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 :

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 :

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
Delivered by FeedBurner

## 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.