Search Interview Questions
| 3167 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Core java - Interview Questions and Answers for 'Citrix' - 2 question(s) found - Order By Newest|
|Very frequently asked. Among first few questions in almost all interviews. Among Top 5 frequently asked questions. Frequently asked in Indian service companies (HCL,TCS,Infosys,Capgemini etc based on multiple feedback )|
|Ans. "equals" is the method of object class which is supposed to be overridden to check object equality, whereas "==" operator evaluate to see if the object handlers on the left and right are pointing to the same object in memory.|
x.equals(y) means the references x and y are holding objects that are equal. x==y means that the references x and y have same object.
String x = new String("str");
String y = new String("str");
System.out.println(x == y); // prints false
System.out.println(x.equals(y)); // prints true
Sample Code for equals
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve java string comparison string object class == equals object equality operator Ebay Cerner GuideWire Expeditors Associate Revature SAIC ValueLabs Realty Redefined Bank Of America Capgemini HCL Technologies Goldman Sachs Symmetric Corp Backstop Solutions Frontier IQOR Science Vanguard eClinicalWorks Experticity Blue Cross and Blue Shield of Kansas ComTrade Banja Luka Overstock.com Intrasoft International IBM Apex Systems infoview technologies Ebix Cumulus Systems Nakisa United HealthGroup (UHG) Sopra Steria TrueCaller Mphasis Amdocs T & A Hr Solutions End2End Catalyst Code Garage Tech IQuest Management Consultants Indianmesh pvt ltd Netsmartz Meander Software UrbanPro.com Netrovert Software T & A Hr Solutions Zscaler Maven Wave Partners Basware India Emerson GCE solutions SmartData Enterprise Shivark Virtual Academy FinXera Sampoorna Consultants Samridhi KKA Technologies bebo technologies Closeloop Technologies DamcoSoft Swar Yantra Technologies SK VedaInfo Universal Trantor Software IT HAT Consulting Kindlebit Solutions Mann McGlynn AmrtData Enterprises Riconz Technologies Embryo Software Solution Corporate Stalwarts Varite Mirror Consultancy Service Wing Global IT Service Regence Adpearance IGNW Centizen Flexton Syntel Kaiser Permanente SkiData New Relic McKesson Finastra Pivotal UST Global Morgan Stanley Kroger Genesys Guardian Life SynergisticIT Leidos Expeditors Associate Polycom Compass Point ClickCare Expedia Equal Experts Dimentrix Intellect Design Arena Epam Systems Qualys Instacart ThoughtWorks Maxgen Technologies Aayansh Germinate Principal Financial Group NineScript Technologies Nihilent infrasoft technologies e-Zest Solutions Krawler Inc FundTech BNT SOFT SAPsphinx Infotech KinderTouch Accede Software Solutions LeadLake Emerson Xoriant Citrix Anonymous Content GS Lab Thermax Saama Technologies Fresherworld.com Nityo Infotech Sanofi Innoplexus Sears IT & Management Services National Stock Exchange of India Accelya Kale Tudip Technologies ITSource Technologies Sela Technology Solutions Eternus Solutions Raja Software Labs Leo TechnoSoft Shubham Housing Development Finance Serene Corporation Leo Technosoft Questionpro Sparken IT Solutions Capsilon JetSynthesys MangoSpring Subway Arezzo Sky Lenco Diagnostic Laboratories Finlogic Technologies Maxxton Cerillion Applus+ XOYAL Acloudzyn Technologies ITYX Tej IT Solutions Transworld Compressor Technologies Deskera Ebaotech Kahuna Systems Kimaya Infotech SSP Technology Boston Byte Bonellisoft Rack Infotech Intellection Software and Technologies OMVSAB IT Solutions ProductDossier Soft Infology Systems Plus Transformations StackMint HeadInfotech India EffortSys KasNet Technologies Java City iSynergy TechSys Unisoft Technologies Servient ThinkQuotient Software Medline Industries Ascent Cyber Solutions Proto-T Solutions Tinker Technologies Censhare Proto-T Solutions Henx International Technologies AlightHub Consulting Services Perpetual Infotech BestoSys Infiniti Infosystems Torqus Spectrum Tech System OreInfo Sanvi Softech Neptune Solutions XTime Web Hub Technology Coin Technologies Paramount Pictures Rocklike DMS Implant Technosoft Solutions Nabla Infotech Predikly Godwit Technologies Kanaka Consulting Aarnum Technologies Ganesh Kapure Abhinav Digicompsoft Services Shoffex.com Online Training Solutions A Plus Tree OMM Software Innovation Tanish Infotech Solution Zinist Software Mobile Sutra Playpixel Infosystem SunGuard Nihilent Siemens PLM Software Maxgen Technologies Nitor Infotech Mediaocean Yagna iQ Sigma Systems Ethon The Permanente Medical Group Reliance Industries MindCraft Software ABM Knowledgeware Trutech Web Solutions Nikhil R Gupta & Associates eMeasurematics NovelERP Solutions Web Element Solutions HDFC Bank Qualcomm Intellect Design Arena Diebold Nixdorf Sharekhan Pepperfry IRIS Business Services Wind World ZEDO Loylty Rewardz Mngt C2L Biz Chenoa Information Services Insolutions Global Vakrangee Softwares Celusion Technologies Currencies Direct Zenith System Solutions Base Information Management Exponentia DataLabs Realty Redefined Constaccent Neoquant Solutions Aureus Analytics Planfirma Technologies Pawaa Software iBhejo Fairfax County Virginia American Conservation Experience Hari Krishna Exports Core Education & Technologies Nishat Mills Industrial Market Place Krisnela Technologies Swissclear Global Samyak Software Professional Access Nexstep Infotech Concerto Software Viral Technologies Silverwing Technologies Gcom Software Inc Accel Frontline Atom Technologies Blue Star Infotech Cynapse Datamatics Global Services Flytxt Mobile Solutions Persistent Systems Onmobile Global Trianz Sasken WNS Global Services Tavant technology Edz Infomatics basic   frequent|
Try 6 Question(s) Test
|What is the difference between = and == in Java ?|
|How is == operator different for objects and primitive types ?|
| What will be the output of following code|
Integer x = 1;
Integer y = 2;
System.out.println(x == y);
What if you change 1 to "1" and Integer to String?
|Very frequently asked. Favorite question in Walk in Drive of many Indian service companies.|
|Ans. Underlying data structure for ArrayList is Array whereas LinkedList is the linked list and hence have following differences -|
1. ArrayList needs continuous memory locations and hence need to be moved to a bigger space if new elements are to be added to a filled array which is not required for LinkedList.
2. Removal and Insertion at specific place in ArrayList requires moving all elements and hence leads to O(n) insertions and removal whereas its constant O(1) for LinkedList.
3. Random access using index in ArrayList is faster than LinkedList which requires traversing the complete list through references.
4. Though Linear Search takes Similar Time for both, Binary Search using LinkedList requires creating new Model called Binary Search Tree which is slower but offers constant time insertion and deletion.
5. For a set of integers you want to sort using quicksort, it's probably faster to use an array; for a set of large structures you want to sort using selection sort, a linked list will be faster.
Sample Code for ArrayList
Sample Code for LinkedList
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve collections java data structures arraylist linkedlist Deutsche Bank Overstock.com HCL Technologies Infosys EBay The Advisory Board Company Accuity JC Penney Cerner Chase Amazon Deloitte Deegit Tata Consultancy Cognizant (CTS) IBM Accenture Accenture India Mindtree ESRI QwikCilver Solutions TMC Bonds GumGum EMC Yelp Classteacher Learning System FactSet Simply Hired SalesForce Royall & Company Indeed eClinicalWorks TravelClick State Farm Manhattan Associates GoEuro Veeva Systems Ness Technologies Marlabs Rolta Volante Technologies Happiest Minds Technologies Coviam Velocify zanox SimplyHired IDBI Intech Wissen Infotech Nike OnDot PexSupply Pramati Technologies Credit Agricole Mastek Six Dee Telecom Accuity Kellton Tech conduent citrix NEC Technologies General Atomics Basic   frequent|
Try 1 Question(s) Test
|If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ?|
| Collections.sort can only be performed on ..|
d. Any Collection implementation
| Is this a valid initialization ? Explain.|
Collection<Collection> collection = new LinkedList<LinkedList>();
|In a Linked list with sorted numbers, insert a new numbers while maintaining the sort order.|
| What is the difference between List, Set and Map ?|
What are the different Java Collections Interfaces ?
|Difference between Vector and ArrayList ?|
|Overridden methods must have the same ...|
|Which of the following doesn't extend Collection interface ?|
|Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ?|