0% found this document useful (0 votes)
547 views

Java Developers Guide - Accenture Java Interview Questions & Answers

This document contains 14 questions and answers related to Java concepts. It discusses class loaders in Java including the bootstrap, extension, and system class loaders. It also addresses differences between static and init blocks, how ConcurrentHashMap works, whether static blocks can throw exceptions, differences between iterator and index access, benefits of character arrays over strings for storing passwords, what daemon threads are, what reflection API is in Java, and differences between the Serializable and Externalizable interfaces.

Uploaded by

Rohini Bauskar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
547 views

Java Developers Guide - Accenture Java Interview Questions & Answers

This document contains 14 questions and answers related to Java concepts. It discusses class loaders in Java including the bootstrap, extension, and system class loaders. It also addresses differences between static and init blocks, how ConcurrentHashMap works, whether static blocks can throw exceptions, differences between iterator and index access, benefits of character arrays over strings for storing passwords, what daemon threads are, what reflection API is in Java, and differences between the Serializable and Externalizable interfaces.

Uploaded by

Rohini Bauskar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Q1.Whydoyouwanttoworkinthisindustry/company?

Ans:Firstyoushouldtrytoconvincethatthiscompanygiveshugeopportunityinmanyaspecti.e.newtechnologies
implementation,thepolicyofcompanysuitsyoulikeprofessionalism.Alsoyoucanmentionthatyouarebigfanof
thiscompanyanditsyourdreamcompany.Basicallyshowyourallpositiveattitudetowardscompany.
Q2.Whichlocationdoyouwanttoworkinandwhy?
Ans:Giveyourownchoice.Alsomentionavalidreasonforwhyyouareinterestedforthatlocation.Thereason
shouldbealwayspositiveandclear.Example:youcansupportyourfamilyfromthislocation,
Q3.Describeaproblemyoufacedandhowyoudealwithit?
Ans:Youcandescribeanyissueyoufacedduringyourprojectworkintheorganization.Andwhatthesolutionyou
haveimplementedforthatissue.
Q4.WhatarethetypesofclassloadersinJava?
Ans:Aspermyknowledgetherearebasically3typesofclassloaderlikebootstarpclassloader,extensionclass
loaderandsystemclassloader.
BootstrapClassLoader
Bootstrapclassloaderloadsjavascoreclasseslikejava.lang,java.utiletc.Theseareclassesthatare
partofjavaruntimeenvironment.Bootstrapclassloaderisnativeimplementationandsotheymaydiffer
acrossdifferentJVMs.
ExtensionsClassLoader
JAVA_HOME/jre/lib/extcontainsjarpackagesthatareextensionsofstandardcorejavaclasses.
Extensionsclassloaderloadsclassesfromthisextfolder.Usingthesystemenvironmentpropery
java.ext.dirsyoucanaddextfoldersandjarfilestobeloadedusingextensionsclassloader
SystemClassLoader
JavaclassesthatareavailableinthejavaclasspathareloadedusingSystemclassloader
Q5.WriteyourownArrayListinJava?
Yourowncodehere.
Q6.Howtoreadandwriteimagefromafile?
Ans:YoucanuseImageIo.read()andImageIO.write()methodofjavax.imageiopackage.
Q7.Whatisdifferencebetweenstaticandinitblockinjava.
AnswerHere.
Q8.HowConcurrentHashMapworks?
Ans:ThebasicdesignofConcurrentHashMapistohandlingthreading.Basicallyitlockseachofthebox(bydefault
16)whichcanbelockedindependentlyandthreadsafeforoperation.Anditdoesnotexposetheinternallock
process.
Q9.Canastaticblockthrowexception?
Ans:Yes.Wecanthrowcheckedexception.

Q10.Whatisdifferencebetweeniteratoraccessandindexaccess?
Ans:Basicallyiteratoraccessprocessthetraverseoperationthrougheachelement,whereindexaccessprocess
accessdirecttheelementbyusingtheindex.
Q11.Whycharacterarrayisbetterthanstringforstoringpasswordinjava?
Ans:Because,characterarraystoresdatainencryptedformatwhichisnotreadablebyhuman.But,thestring
storesthedatainhumanreadableformatwhichisnotsecure.
Q12.whatisdaemonthreadinjava?
Ans:Adaemonthreadisnormallyrunsonbackground.AnditdoesnotpreventtheJVMfromexitingwhenthe
programfinishesbutthethreadisstillrunning.
Q13.WhatisJavaReflectionAPI?
Ans:Reflectionisoneofthemostpowerfulapiwhichhelptoworkwithclasses,methodsandvariables
dynamically.Basicallyitinspecttheclassattributesatruntime.Alsowecansayitprovidesametadataaboutthe
class.
Q14.WhatisthedifferencebetweenSerializableandExternalizableinterfaces?
Ans:Bothinterfacesareusedforimplementserialization.But,thebasicdifferenceisSerializableinterfacedoesnot
haveanymethod(itsamarkerinterface)andExternalizableinterfacehaving2methodssuchasreadExternal()and
writeExternal().SerializableinterfaceisthesuperinterfaceforExternalizableinterface.

You might also like