Java - Interview Questions and Answers for 'GuideWire' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2137 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'GuideWire' - 3 question(s) found - Order By Newest

Very Very frequently asked. Among the first few questions in almost all interviews.Among Top 5 frequently asked questions. Frequently asked in Indian service companies (HCL,TCS,Infosys 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

 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     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      basic        frequent

Try 6 Question(s) Test


Related 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?


 Q2. What are different ways to create String Object? Explain.Core Java
Admin
info@buggybread.com
Ans.
String str = new String("abc");
String str1 = "abc";


When we create a String using double quotes, JVM looks in the String pool to find if any other String is stored with same value. If found, it just returns the reference to that String object else it creates a new String object with given value and stores it in the String pool.

When we use new operator, JVM creates the String object but dont store it into the String Pool. We can use intern() method to store the String object into String pool or return the reference if there is already a String with equal value present in the pool.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   string class   string   jvm   memory management   string pool     GuideWire  NTT Data  Fractal Analytics      basic        frequent

Try 3 Question(s) Test


Related Questions

  Does garbage collection guarantee that a program will not run out of memory?
  Describe what happens when an object is created in Java ?
  Describe, in general, how java's garbage collector works ?
  What are various types of Class loaders used by JVM ?
 Why two types of memory - stack and heap are required by Java ?
  Different types of memory used by JVM ?
  What is a class loader ? What are the different class loaders used by JVM ?
  Should we override finalize method ?
  Why do member variables have default values whereas local variables don't have any default value ?


  Q3. What is a String Pool ?Core Java
Anonymous
Ans. String pool (String intern pool) is a special storage area in Java heap. When a string is created and if the string already exists in the pool, the reference of the existing string will be returned, instead of creating a new object and returning its reference.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   oops   string   string class   string pool   heap memory     SAS Institute  Ariba  GuideWire  Harbinger  Oracle  Virtusa  Knoa  Polaris  GuideWire  HCL Technologies  Tata Consultancy (TCS)  Infosys  Technologent  MphasiS  Harbinger Group  Kony  Evergent  NTT Data  VMware  Markit  Ariba  Tech Mahindra  Bureau Veritas  InfoStretch  PTC Software  Mindtree  Centre for Internet and Society (CIS)  Trimax IT Infrastructure & Services      intermediate        frequent

Try 2 Question(s) Test


Related Questions

  What are different ways to create String Object? Explain.
  Why Char array is preferred over String for storing password?
 How does making string as immutable helps with securing information ? How does String Pool pose a security threat ?
 Which memory segment holds String Pool in Java ?
 How and Why Strings are interned in Java ?
 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?
 What will be result of following code and why

Integer int1 = 1;
Integer int2 = 1;
String str1 = new String("str");
String str2 = new String("str");
String str3 = "str";
String str4 = "str";

      
System.out.println(int1 == int2);
System.out.println(str1 == str2);
System.out.println(str3 == str4);
 What is the purpose of String Pool ? Don't you think it's a performance overhead to have unnecessary check for string in string pool ?




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

2 person from are looking for questions for 'GuideWire'. Connect with them to better prepare for your interview.
X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: