Interview Questions and Answers for 'MindFire' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



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

Very frequently asked in different variations. Frequently asked in Deloitte ( 2 feedback ) , HCL Tech ( 3 feedback ), TCS and Coginizant (CTS)
  Q1. Explain the scenerios to choose between String , StringBuilder and StringBuffer ?

or

What is the difference between String , StringBuilder and StringBuffer ?
Core Java
Ans. If the Object value will not change, use String Class because a String object is immutable.

If the Object value can change and will only be modified from a single thread, use StringBuilder because StringBuilder is unsynchronized(means faster).

If the Object value may change, and can be modified by multiple threads, use a StringBuffer because StringBuffer is thread safe(synchronized).

  Sample Code for String

  Sample Code for StringBuffer

  Sample Code for StringBuilder

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

   Like         Discuss         Correct / Improve     java   string class   string   stringbuilder   stringbuffer   String vs StringBuffer   String vs StringBuilder   String vs StringBuilder vs StringBuffer   StringBuffer vs stringBuilder     Asked in 29 Companies      basic        frequent

Try 3 Question(s) Test


Related Questions

  Difference between == and .equals() ?
  Why is String immutable in Java ?
  Why Char array is preferred over String for storing password?
  What are different ways to create String Object? Explain.
  What is a String Pool ?
 How does making string as immutable helps with securing information ? How does String Pool pose a security threat ?
 How is string object immutable if we can concat a string to it ?
  What is StringJoiner ?
 Which of the following is false about main method ?

a. It should be declared public and static
b. it should have only 1 argument of type String array
c. We can override main method
d. We can overload main method


  Q2. Explain OOPs

or

Explain OOPs Principles

or

Explain OOPs Concepts

or

Explain OOPs features

or

Tell me something about OOPs
Core Java
Ans. OOPs or Object Oriented Programming is a Programming model which is organized around Objects instead of processes. Instead of a process calling series of processes, this model stresses on communication between objects. Objects that all self sustained, provide security by encapsulating it's members and providing abstracted interfaces over the functions it performs. OOP's facilitate the following features

1. Inheritance for Code Reuse
2. Abstraction for modularity, maintenance and agility
3. Encapsulation for security and protection
4. Polymorphism for flexibility and interfacing

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

   Like         Discuss         Correct / Improve     oops  oops features     Asked in 260 Companies      basic        frequent


Related Questions

 Can you give a real world example of Encapsulation and Abstraction ?
 Which of the following Java feature promotes access protection or Hiding ?

a. Inheritance
b. Encapsulation
c. Abstraction
d. Composition
 Define encapsulation in Java ?
 Give an example of how Object Oriented Programming Concepts can be implemented.
 Which of the OOP's features facilitate dependency injection ?
 Which of the OOP's feature - encapsulation or abstraction - is more important ?
 Which of the polymorphism type - static or runtime - is more important ?
 Which of the OOP's feature is most important ?


Very frequently asked. Usually asked in different variants like Diff between StringBuffer , String Builder ; Difference between StringBuilder and String class; Choice between these classes etc.
  Q3. What is the difference between StringBuffer and String class ?Core Java
Ans. A string buffer implements a mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.

The String class represents character strings. All string literals in Java programs, such as "abc" are constant and implemented as instances of this class; their values cannot be changed after they are created.

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

   Like         Discuss         Correct / Improve     java   string   stringbuffer   frequently asked     Asked in 18 Companies      basic        frequent

Try 1 Question(s) Test


Related Questions

  Difference between == and .equals() ?
  Why is String immutable in Java ?
  Explain the scenerios to choose between String , StringBuilder and StringBuffer ?

or

What is the difference between String , StringBuilder and StringBuffer ?
  Why Char array is preferred over String for storing password?
  What are different ways to create String Object? Explain.
  What is a String Pool ?
 How does making string as immutable helps with securing information ? How does String Pool pose a security threat ?
 How is string object immutable if we can concat a string to it ?
  What is StringJoiner ?
 Which of the following is false about main method ?

a. It should be declared public and static
b. it should have only 1 argument of type String array
c. We can override main method
d. We can overload main method



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: