Interview Questions and Answers for 'Onmobile Global' - 3 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 ) Q1. Difference between == and .equals() ? Core Java Anonymous
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.
Sample code:
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 : VIDEO 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) TestRelated Questions 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? Frequently asked in face to face interviews. Q2. Write a program to print fibonacci series. Core Java
Ans. int count = 15;
int[] fibonacci = new int[count];
fibonacci[0] = 0;
fibonacci[1] = 1;
for(int x=2; x < count; x++){
fibonacci[x] = fibonacci[x-1] + fibonacci[x-2];
}
for(int x=0; x< count; x++){
System.out.print(fibonacci[x] + " ");
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve ebay fibonacci series Manvish eTech Belvedere Trading King UK FinaTel Goldman Sachs Enlighten Software Misys Mahindra Comviva ZapCom Nucleus Software Exports Enlighten Sears Mahindra Satyam Insperity General Motors AVIS e Solutions Paddy Power Betfair TurningCloud Polestar Solutions BlueWhale Solutions CitiusTech Zuhlke Comcast KGFSL Quickr Paramatrix Technologies CalSoft Ancestry.com OnMobile Global NBCUniversal Inventum Technologies Hughes Systique Flextronics Geometric Soft Check Point Software Technologies ZapLabs Indecomm Global Services HTC Global Quovantis Technologies Mobiloitte Riktam Technologies DMX Technologies Mojo Networks Tata Elxsi Ciena ServiceNow EverBridge LendingClub Virtusa Polaris West Corporation Ebay Walmart HomeAway AllClear ID Quinnox Software Acquity Group Cadence Design Systems SmartPrix Leidos Zoho Varian Medical Systems HealthSparq karya technology Canopy Tax 23AndMe basic   frequent Related Questions What are the steps to be performed while coding Junit with Mocking framework ? What is a Sequence File? What different level of logging you use while coding ? Have you ever encoded the response before sending it back from the service? If Yes , Which encoding was used ? What are the different type of encoding you have used ? How does encoding affect using Reader / writer classes or Stream classes in Java ? Q3. What are the core OOPs concepts ? Core Java 2017-02-06 16:15:55
Ans. Abstraction, Encapsulation, Polymorphism , Composition and Inheritance Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve core oops concepts 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 Wipro Tech Mahindra Patni Computers L&T Infotech Mphasis Mindtree Hexaware Collabera 3i Infotech IGate Kpit Technologies NIIT Technologies Trianz Persistent Systems IT Asset basic   frequent Related Questions What are the difference between composition and inheritance in Java? What are points to consider in terms of access modifier when we are overriding any method? What is the difference between Encapsulation and Abstraction? Why every object constructor automatically call super() in Object before its own constructors? What is Polymorphism in Java ? Explain OOPs
or
Explain OOPs Principles
or
Explain OOPs Concepts
or
Explain OOPs features
or
Tell me something about OOPs Difference between Overloading and Overriding ? Difference between Composition and Inheritance ? Can you give a real world example of Encapsulation and Abstraction ? How compiler handles the exceptions in overriding ?