Interview Questions and Answers for 'Set' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 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

   



Interview Questions and Answers - Order By Newest

   
 Q41. What is setter injection ?Spring
Ans. Setter Injection in Spring is a type of dependency injection in which the framework injects the dependent objects into the client using a setter method.

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

   Like         Discuss         Correct / Improve     setter injection   dependency injection     Asked in 2 Companies


 Q42. What is the difference between TreeSet and TreeMap ?Core Java
Ans. TreeSet contains only values as elements whereas TreeMap contains Key value pairs.

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

   Like         Discuss         Correct / Improve     reeMap  TreeSet  Collections  sorted collection     Asked in 1 Companies        rare


 Q43. How to sort objects based on one of the field ?Core Java
Ans. Using comparable and comparator and sorted collections like TreeSet or TreeMap.

or

use stream api from java 8 onwards which internally refers to comparable and comparator through lambda expressions

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

   Like         Discuss         Correct / Improve     sort  sorting  comprator  comparable  treeset  treemap  sorting collections     Asked in 1 Companies      Basic        frequent


 Q44. How to run jar file using command promptCore Java
 This question was recently asked at 'CIGNEX Datamatics'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     jar  running jar using command line  cron entry   setting java app as cron     Asked in 1 Companies


 Q45. Can we ssh into subnet without a internet gateway ?Amazon Web Services (AWS)
Ans. No

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

   Like         Discuss         Correct / Improve     aws subset  aws internet gateway


 Q46. Difference between ArrayList and HashSet ?Core Java
Ans. ArrayList is a list , i.e an implementation of List interface whereas HashSet is a Set and an implementation of Set interface.

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

   Like         Discuss         Correct / Improve     arraylist  hashset


 Q47. Write a program to make an array act as a set.Core Java
Ans. public Set convertArrayToList(T array[]) {
Set set = new HashSet<>(Arrays.asList(array));
return set;
}

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

   Like         Discuss         Correct / Improve     arrays  collections set     Asked in 1 Companies


 Q48. Difference between XSS and CSRF ?Security
Ans. SRF attack requires an authenticated session, whereas an XSS attack doesn’t.
XSS doesn’t require any user interaction.CSRF is restricted to the actions the victim can perform.
XSS requires a vulnerability to happen, whereas CSRF relies on tricking the user to click a link or access a page.
CSRF can only send an HTTP request but cannot view the response. XSS can send and receive HTTP requests and responses to extract the required data.

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

   Like         Discuss         Correct / Improve     xss attack  csrf attack  security vulnerabilities  security attack  web security     Asked in 3 Companies


 Q49. What will be the output upon executing main method ?

public static void main(String[] args){
      Set set = new HashSet();
      set.add(1);
      set.add(2);
      set.add(3);
      System.out.println(set);
   }
Core Java
a. 1,2,3
b. Order cannot be determined
c. Compilation error
d. 3,2,1

Ans.b. Order cannot be determined

 Q50. Which of following stores its elements in natural Sorting Order ?Core Java
a. AbstractSet
b. HashSet
c. LinkedHashSet
d. TreeSet

Ans.d. TreeSet

previous 30   

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: