Virtusa Interview Questions for Java Experience Professionals

 

 

Role: Java Developer

Job Description: Core Java, Collections, Springs, Hibernate, PL/SQL

Questions :
– Tell about yourself
– Have you did any Certification.?
– Stored Procedure to remove all Duplicate Rows from Table
– What are immutable Classes
– How to create a custom immutable class
– In How many ways we create Objects in java
– Hashmap
– Equals method available in which class
– Serialization

Source Tree:
Who you resolve the conflicts in git push

Maven :
Pom.xml
How you download the dependencies using maven.?

Solutions : 

In How many ways we create Objects in java .?

  1. i) Using ‘new’ operator:

Test s=new Test();

  1. ii) Factory method:

Thread t=Thread.currentThread();

iii)  newInstance():

Class c=Class.forName(“Test”);

Object obj=c.newInstance();           àcreates Test class Object.

Test t=(Test)obj;

  1. iv) clone():

Test t1=new Test(10,20);

Test t2=t1.clone();

  1. v)   Deserialization:

FileInputStream fis=new FileInputStream(“Test.txt”);

ObjectInputStream ois=new ObjectInputStream(fis);

 UserDefSerCls   uds=new UserDefSerCls(,” ”,);

Ois.readObject(uds);

Ois.close();

 

 

– Equals method available in which class – Objects Class

Pom.xml
How you download the dependencies using maven.?

What is the output of below Program :

[java]
String s = new String("Hello");
String s = "Hello";
[/java]

[xml] <dependencies><dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.3.156</version> </dependency></dependencies> [/xml]

After adding the dependencies we run the command  “mvn clean package”. it downloads all the dependency jar files for me.


																		
						
						
											

Add a Comment

Your email address will not be published. Required fields are marked *