Interview Questions and Answers - Order By Rating Q1921. Name few Threads related classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-threads-classes-and-interfaces.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   threads   multithreading Q1922. Name few Boolean classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-data-types-double-classes-and_31.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   data types   boolean Q1923. Name few Double data types related classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-data-types-double-classes-and.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   data types   double Q1924. Name few float data type related classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-data-types-float-classes-and.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   data types   float Q1925. Name few long data type related classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-data-types-long-classes-and.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   data types   long Q1926. Name few Queue classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-collections-queue-classes-and.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   queue Q1927. What are few iterator classes provided by Java ?
Ans. http://www.buggybread.com/2015/01/java-iterator-classes-and-interfaces.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   collections   iterator Q1928. Name few File IO related classes and interfaces ? Core Java
Ans. http://www.buggybread.com/2015/01/java-file-io-classes-and-interfaces.html Sample Code for File Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   io   input output   file io  file handling Q1929. Name few classes that are part of java.lang package ?
Ans. http://www.buggybread.com/2015/01/java-javalang-classes-and-interfaces.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java.lang Q1930. Name few classes that are part of java.util package ?
Ans. http://www.buggybread.com/2015/01/java-javautil-classes-and-interfaces.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java.util Q1931. Name few Java util classes that were introduced with Java 7 ?
Ans. http://www.buggybread.com/2015/01/migrating-to-java-7-new-classes_25.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java.util   util   java 7   java7 Q1932. Name few Java Util classes introduced with Java 8 ? Core Java
Ans. http://www.buggybread.com/2015/01/migrating-to-java-8-new-classes_25.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java.util   util   java 8   java8Rarely asked as it was introduced with Java 8. Q1933. Name few java.lang classes introduced with Java 8 ? Core Java
Ans. http://www.buggybread.com/2015/01/migrating-to-java-8-new-classes.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   java.lang   java8   java 8 Q1934. How to make sure that a string contains only Numerals ? Core Java
Ans. We can use NumberUtils.isNumber which is a part of apache commons package. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   apache commons   numberutils   numberutils.isnumberAns. It is a continuous integration tool written in Java. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   jenkins Asked in 6 Companies Basic   frequent Q1936. What are the various ways in which build can be scheduled in Jenkins ? Jenkins
Ans. Builds can be triggered by source code management commits. Can be triggered after completion of other builds. Can be scheduled to run at specified time ( crons ) Manual Build Requests Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   jenkins   build management   build manager Q1937. Do you know the way to remove unused imports automatically in eclipse ? Eclipse
Ans. Select the package -> Right Click -> Source -> Organize Imports. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  eclipse   import statement   code cleaning   code review   clean code Q1938. What is Nagios ?
Ans. Nagios is open source system , network and infrastructure monitoring software application. It alerts the user if anything goes wrong. Nagios is widely used as monitoring tool for enterprise applications. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  production support   application support   nagios   system monitoring Q1939. Should we have instance variables in the Spring Bean which has been scoped as Singleton ? Spring
Ans. No, if required we should only have final variables.Bean scoped singleton means that only one instance of the bean will be created and will be shared among different requests and hence instance variables will get shared too. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   singleton   spring framework   spring beans Q1940. What is the difference between Fisheye and Crucible ?
Ans. FishEye is used to extract information from source code repository whereas Crucible is used to request, perform and manage code reviews. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   fisheye   crucible   code review   tools Q1941. Can we use Fisheye and Crucible independently ?
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   fisheye   crucible   code review   tools   yes-no Q1942. What does the red and green line backgrounds denotes in the crucible code Review ?
Ans. Red Background for a line denotes the lines that have been deleted with the change set and Green background denotes the addition. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   crucible   fisheye   code reviewFrequently asked in Tata Consultancy (TCS) interview ( Based on 2 Feedback ) Q1943. What are the technologies used in Jira ? Tools
Ans. JIRA is written in Java and uses the Pico IOC container,Apache OFBiz entity engine, and WebWork technology stack. For remote procedure calls (RPC), JIRA supports REST, SOAP, and XML RPC. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   jira   issue management   defect management Asked in 5 Companies expert Q1944. What are stateless objects ? How are they different from immutable objects ? Which of these two is thread safe ? Object Oriented Programming
Ans. Stateless objects are the objects without instance fields (instance variables). The class may have compile time constants i.e static final fields.Immutable objects are the objects which have state but the state cannot be changed after initialization. Both are Thread safe. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   stateless objects   immutable  immutability objects   objects   singleton scopeAns. They can be shared across multiple threads as they are thread safe. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   stateless objects   immutable  immutability objects   objects Q1946. What are the advantages and disadvantages of static variables and static methods ? Core Java
Ans. Advantages
Can do meta object operations ( like validating something before creating objects , keep count of number of objects )
Can do operations which have nothing to do with objects but still you want them to be tied to Class.
Disadvantages
Commonly used to static variables sometime leads to problems due to access by different objects.
Are not tied to objects so doesn't reflect pure Object Oriented approach.
Needs to be synchronized so as to avoid update conflicts by mutiple objects and threads.
Some limitation in testing as not all frameworks have facility to mock them. Powermock has but Mockito doesnt Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   static   static variables   static methods Q1947. Write code explaining use of Scanner class ?
Ans. Scanner sc = new Scanner(System.in);
int i = sc.nextInt(); Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   scanner   io   console io   scanner   System.inVery Frequently asked. Have been asked in HCL Technologies very frequently ( based on 3 feedback ). Among first few questions in many interviews. Q1948. Differences between abstract class and interface ? Core Java
Ans. Abstract classes can have both abstract methods ( method declarations ) as well as concrete methods ( inherited to the derived classes ) whereas Interfaces can only have abstract methods ( method declarations ).
A class can extend single abstract class whereas it can implement multiple interfaces. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   classes   abstract class   interfaces   abstract class vs interface   abstract classes vs interfaces Asked in 82 Companies basic   frequent Q1949. In which cases isn't instanceof operator a bad practice? Core Java
Ans. To avoid ClassCastException.
Though the following code will compile fine but will result in ClassCastException during runtime.
Fruit fruit = new Apple();
Banana banana = Banana(fruit); // ClassCastException
This code will not give compile time error as Banana and Fruit are related as Banana either extends or implement Fruit, So downcasting is acceptable. With this code we assume that the Fruit handler will have the Apple object at that point, violating which the code will throw the exception.
This exception can be avoided by following code.
Fruit fruit = new Apple();
if(fruit instanceOf Banana){
Banana banana = Banana(fruit); // ClassCastException
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   instanceof   classcastexception   runtime exceptions  instanceOf operator Try 2 Question(s) Test Q1950. Difference between Scanner and BufferedReader ? Which one is faster and Why ? Core Java
Ans. Scanner is used for parsing tokens from the contents of the stream while BufferedReader just reads the stream.
BufferedReader read files efficiently by using a buffer to avoid physical disk operations.
Buffer size of Scanner is usually smaller than the Buffered Writer.
BufferedReader is faster that Scanner as it just reads the Stream and doesn't Parse the tokens to read the stream into primitive data types. Sample Code for Scanner Sample Code for BufferedReader Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   file io   input output   scanner   bufferedreader  file handling