Interview Questions and Answers for 'Vyom labs' - 3 question(s) found - Order By Newest Frequently asked in Infosys and HCL Technologies ( Based on 2 feedback ) Q1. What are different ways of object creation in Java ? Core Java
Ans. Using new operator - new xyzClass()
Using factory methods - xyzFactory.getInstance( )
Using newInstance( ) method - (Class.forName(xyzClass))emp.newInstance( )
By cloning an already available object - (xyzClass)obj1.clone( ) Sample Code for object initialization using clone Sample Code for object initialization using getInstance Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   oops   object creation   new operator   class.forname   cloning   ebay Asked in 9 Companies expert Related Questions Describe what happens when an object is created in Java ? Does Constructor creates the object ? Difference between new operator and Class.forName().newInstance() ? Difference between Class#getInstance() and new operator ? In a case where there are no instance variables what does the default constructor initialize? How can we prevent duplicate object creation in Java? 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 Asked in 16 Companies basic   frequent Related Questions What is session tracking and how do you track a user session in servlets? what is the use of cookie and session ? and What is the difference between them ? What are different types of cookies ? Why using cookie to store session info is a better idea than just using session info in the request ? http protocol is by default ... ? How cookies helps by storing encrypted passwords ? Is it front end code or the back end code , that drops the cookies ? How can we drop cookies through back end code ? Does it transfer the cookie file to the client ? What is SameSite cookie attribute ? Q3. What is collection framework in Java ? Core Java
Ans. The Java collections framework (JCF) is a set of classes and interfaces that implement commonly reusable collection data structures. Although referred to as a framework, it works in a manner of a library. The JCF provides both interfaces that define various collections and classes that implement them. Sample Code for Map Sample Code for HashMap Sample Code for Treemap Sample Code for set Sample Code for hashset Sample Code for treeset Sample Code for list Sample Code for arraylist Sample Code for linkedlist Sample Code for queue Sample Code for priorityqueue Sample Code for concurrenthashmap Sample Code for vector Sample Code for stack Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  collections Asked in 9 Companies basic   frequent Related Questions What is the difference between ArrayList and LinkedList ? If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ? Difference between TreeMap and HashMap ? Difference between HashMap and Hashtable? Can you provide some implementation of a Dictionary having large number of words ? Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ? How is Hashmap internally implemented in Java ? What are strong, soft, weak and phantom references in Java ? what is fail fast and Fail Safe in collections? What is a ConcurrentHashMap ?