Interview Questions and Answers for 'Hitachi' | 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 'Hitachi' - 7 question(s) found - Order By Rating

 Q1. In what terms Java is better language than c and c++ ?
Ans. Java manages pointers intrinsically and gives no control over pointer arithmetic to coders and hence saves the applications from many possible problems like dangling pointers and memory leaks.

Java is platform independent and hence any application can be run on any hardware with the suitable JVM without building it separately for different hardwares.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q2. Are you willing to spend long hours ?General
Ans. why not if getting money in dollars!

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

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q3. Find all files from a directory (including sub directories ) that could contain dates in a specific format.Unix
 This question was recently asked at 'Hitachi'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q4. Write a Program to find number of lines , words and characters in a File.Core Java
Ans. import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class FileUtility {

public static void main(String[] args) {
System.out.println(printFile("/home/userme/notes"));
}

private static int printFile(String filePath) {
int wordCount = 0;
try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
String line = null;
String[] wordsArray = null;

while ((line = br.readLine()) != null) {
wordsArray = line.split(" ");
wordCount = wordsArray.length;
}
} catch (IOException e) {
e.printStackTrace();
}
return wordCount;

}
}

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

   Like         Discuss         Correct / Improve     code  coding     Asked in 2 Companies


 Q5. What is a Webdriver ?Testing
Ans. Selenium WebDriver is a tool for automating web application testing.It helps in replicating the manual tester behavior like keyboard entry, mouse events etc and then matching the output against the expected.

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

   Like         Discuss         Correct / Improve     selenium  webdriver     Asked in 37 Companies


Very frequently asked in different variations. Frequently asked in Deloitte ( 2 feedback ) , HCL Tech ( 3 feedback ), TCS and Coginizant (CTS)
  Q6. 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


  Q7. Write a method to check if input String is Palindrome?Core Java
Ans. private static boolean isPalindrome(String str) {

if (str == null)
return false;

StringBuilder strBuilder = new StringBuilder(str);

strBuilder.reverse();

return strBuilder.toString().equals(str);

}

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

   Like         Discuss         Correct / Improve     java   string   stringbuilder   stringbuilder   string class   code   palindrome     Asked in 38 Companies      Basic        frequent



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: