Posts

Exception Handling

Exception Handling Information regarding Exception:-  Dictionary meaning of the exception is abnormal termination. An expected event that disturbs or terminates normal flow of execution called exception. If the application contains exception then the program terminated abnormally the rest of the  application is not executed. To overcome above limi tation in order to execute the rest of the application must handle the  exception. In java we are having two approaches to handle the exceptions. 1)  By using try-catch block. 2)  By using throws keyword. Exception Handling:- The main objective of exception handling is to get normal termination of the application in order to execute rest of the application code. Exception handling means just we are providing alternate code to continue the execution of remaining code and to get normal termination of the application. Every Exception is a predefined class present in different packages. java.lang.Arith

Wrapper Class

Image
Wrapper classes Java is an Object oriented programming language so represent everything in the form of the object, but java supports 8 primitive data types these all are not part of object. To represent 8 primitive data types in the form of object form we required 8 java classes these classes are called wrapper classes. All wrapper classes present in the java.lang package and these all classes are immutable classes. Wrapper classes hierarchy Wrapper classes Constructor Integer i = new Integer(10); Integer i1 = new Integer("100"); Float f1= new Float(10.5); Float f1= new Float(10.5f); Float f1= new Float("10.5"); Character ch = new Character('a'); datatypes wrapper-class constructors byte Byte byte,String short Short short,String int Integer int,String long Long

Garbage Collector Interview Questions

1. What is the functionality of Garbage collector? 2. How many ways are there to make eligible our objects to Garbage collector? 3. How to call Garbage collector explicitly? 4. What is the purpose of gc( ) method? 5. What is the purpose of finalize() method? 6. If the exception raised in finalize block what happenederror or output? 7. What is the purpose of RunTime class? 8. How to create object of RunTime class? 9. What is singleton class? 10. What is the algorithm fallowed by GC? 11. What is the difference between final , finally , finalize()? 12. When GarbageCollector calls finalize()? 13. Finalize method present in which class? 14. Which part of the memory involved in garbage collector Heap or Stack? 15. Who creates stack memory and who destroy that memory? 16. What do you mean by demon thread? Is Garbage collector is DemonThread? 17. How many times Garbage collector does call finalize() method for object? 18. What are the different ways to call Garbage collector

Collections Framework Interview Questions for Fresher and Experienced

1) What is the main objective of collections? 2) What are the advantages of collections over arrays? 3) Collection frame work classes are present in which package? 4) What is the root interface of collections? 5) List out implementation classes of List interface? 6) List out implementation classes of set interface? 7) List out implementation classes of map interface? 8) What is the difference between heterogeneous and homogeneous data? 9) What do you mean by legacy class can you please tell me some of the legacy classes present in collection framework? 10) What are the characteristics of collection classe? 11) What is the purpose of generic version of collection classes? 12) What is the difference between general version of ArrayList and generic version of ArrayList? 13) What is purpose of generic version of ArrayList& arrays? 14) How to get Array by using ArrayList? 15) What is the difference betweenArrayList and LinkedList? 16) How to decide when to use ArrayList

Multithreading Interview Question for Fresher and Experienced

What do you mean by Thread? 2. What do you mean by single threaded model? 3. What is the difference single threaded model and multithreaded model? 4. What do you mean by main thread and what is the importance? 5. What is the difference between process and thread? 6. How many ways are there to create thread which one prefer? 7. Thread class& Runnable interface present in which package? 8. Runnable interface is marker interface or not? 9. What is the difference between t.start() &t.run() methods where t is object of Thread class? 10. How to start the thread? 11. What are the life cycle methods of thread? 12. Run() method present in class/interface ?Is it possible to override run() method or not? 13. Is it possible to override start method or not? 14. What is the purpose of thread scheduler? 15. Thread Scheduler fallows which algorithm? 16. What is purpose of thread priority? 17. What is purpose of sleep() &isAlive() &isDemon() & join() &getId() &

String Interview Question for Fresher and Experienced

1) How many ways to create a String object &StringBuffer object? 2) What is the difference between? a. String str=”pritam”; b. String str = new String(“pritam”); 3) equals() method present in which class? 4) What is purpose of String class equals() method. 5) What is the difference between equals() and == operator? 6) What is the difference between by immutability & immutability? 7) Can you please tell me some of the immutable classes and mutable classes? 8) String &StringBuffer&StringBuilder&StringTokenizer presented package names? 9) What is the purpose of String class equals() &StringBuffer class equals()? 10) What is the purpose of StringTokenizernd this class functionality replaced method name? 11) How to reverse String class content? 12) What is the purpose of trim? 13) Is it possible to create StringBuffer object by passing String object as a argument? 14) What is the difference between concat() method & append()? 15) What is the purpo

Interfaces Interview Questions for Fresher and Experienced

1.What do you mean by interface how to declare interfaces in java? 2. Interfaces allows normal methods or abstract methods or both? 3. For the interfaces compiler generates .class files or not? 4. Interface is also known as? 5. What is the abstract method? 6. By default modifiers of interface methods? 7. What is the purpose of implements keyword? 8. Is it possible to declare variables in interface ? 9. Can abstract class have constructor ?can interface have constructor? 10. What must a class do to implement interface? 11. What do you by implementation class? 12. Is it possible to create object of interfaces? 13. What do you mean by abstract class? 14. When we will get compilation error like “attempting to assign weaker access privileges”? 15. What do you mean by helper class? 16. Which of the fallowing declarations are valid & invalid?   a. class A implements it1   b. class A implements it1,it2,it3   c. interface it1 extends it2   d.interface it1 extends it2,it3