Posts

Showing posts from February, 2018

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

Exception handling Interview Questions for Fresher and Experienced

1. What do you mean by Exception? 2. How many types of exceptions in java? 3. What is the difference between Exception and error? 4. What is the difference between checked Exception and un-checked Exception? 5. Checked exceptions are caused by? 6. Unchecked exceptions are caused by? 7. Errors are caused by? 8. Is it possible to handle Errors in java? 9. What the difference is between partially checked and fully checked Exception? 10. What do you mean by exception handling? 11. How many ways are there to handle the exception? 12. What is the root class of Exception handling? 13. Can you please write some of checked and un-checked exceptions in java? 14. What are the keywords present in Exception handling? 15. What is the purpose of try block? 16. In java is it possible to write try with out catch or not? 17. What is the purpose catch block? 18. What is the difference between try-catch? 19. Is it possible to write normal code in between try-catch blocks? 20. What are

Packages Interview Question for fresher

1. What do you mean by package and what it contains? 2. What is the difference between user defined package and predefined package? 3. What are coding conventions must fallow while declaring user defined package names? 4. Is it possible to declare motile packages in single source file? 5. What do you mean by import? 6. What is the location of predefined packages in our system? 7. How many types of imports present in java explain it? 8. How to import individual class and all classes of packages and which one is recommended? 9. What do you mean by static import? 10. What is the difference between normal and static import? 11. Is it possible to import multiple packages in single source file? 12. Is it possible to declare multiple packages in single source file? 13. I am importing two packages, both packages contains one class with same name at that situation how to create object of two package classes? 14. If we are importing root package at that situation is it possible to

OOPs Interview Questions for Fresher and Experienced

1) What are the main building blocks of oops? 2) What do you mean by inheritance? 3) How to achieve inheritance concept and inheritance is also known as? 4) How many types of inheritance in java and how many types of inheritance not supported by java? 5) How to prevent inheritance concept? 6) What is the purpose of extends keyword? 7) What do you mean by cyclic inheritance java supporting or not? 8) What is the difference between child class and parent class? 9) What is the root class for all java classes? 10) Inside the constructor if we are not providing this() and super() keyword the compiler generated which type of super keyword? 11) How to call super class constructors? 12) Is it possible to use both super and this keyword inside the method? 13) Is it possible to use both super and this keyword inside the constructor? 14) If the child class and parent class contains same variable name that situation how to call parent class variable in child class? 15) One class ab

Flow control statement Interview Questions for Fresher and Experienced

1) How many flow control statements in java? 2) What is the purpose of conditional statements? 3) What is the purpose of looping statements? 4) What are the allowed arguments of switch? 5) When we will get compilation error like “possible loss of precision”? 6) Inside the switch case vs. default vs. Break is optional or mandatory? 7) Switch is allowed String argument or not? 8) Inside the switch how many cases are possible and how many default declarations are< possible? 9) What is difference between if & if-else & switch? 10) What is the default condition of for loop? 11) Inside for initialization & condition & increment/decrement parts optional or mandatory? 12) When we will get compilation error like “incompatible types”? 13) We are able to use break statements how many places and what are the places? 14) What is the difference between break& continue? 15) What do you mean by transfer statements and what are transfer statements present in java?

Java Class declaration interview Questions

1) What is present version of java and initial version of java? 2) How many modifiers in java and how many keywords in java? 3) What is initial name of java and present name of java? 4) Can we have multiple public classes in single source file? 5) Can we create multiple objects for single class? 6) What do you mean by token and literal? 7) What do you mean by identifier? 8) Is it possible to declare multiple public classes in single source file? 9) What is the difference between editor and IDE(integrated development environment) 10) Write the examples of editor and IDE? 11) Define a class? 12) In java program starts form which method and who is calling that method? 13) What are the commands required for compilation and execution? 14) Can we compile multiple source files at a time and is it possible to execute multiple .classes at a time? 15) The compiler understandable file format and JVM understandable file format? 16) What is the difference between JRE and JDK? 17)