registration
Are you an Employer?

Core Java interview questions & Answers

List of Topics

Core Java Interview questions

  • What Is The Most Important Feature Of Java?

    Java is a platform independent language.

  • What Do You Mean By Platform Independence?

  • Are Jvm's Platform Independent?

  • What Is A Jvm?

  • What Is The Difference Between A Jdk And A Jvm?

  • What Is A Pointer And Does Java Support Pointers?

  • What Is The Base Class Of All Classes?

  • Does Java Support Multiple Inheritance?

  • Is Java A Pure Object Oriented Language?

  • Are Arrays Primitive Data Types?

  • What Is Difference Between Path And Classpath?

  • What Are Local Variables?

  • What Are Instance Variables?

  • How To Define A Constant Variable In Java?

  • Should A Main Method Be Compulsorily Declared In All Java Classes?

  • What Is The Return Type Of The Main Method?

  • Why Is The Main Method Declared Static?

  • What Is The Arguement Of Main Method?

  • Can A Main Method Be Overloaded?

  • Can A Main Method Be Declared Final?

  • Does The Order Of Public And Static Declaration Matter In Main Method?

  • Can A Source File Contain More Than One Class Declaration?

  • What Is A Package?

  • Which Package Is Imported By Default?

  • Can A Class Declared As Private Be Accessed Outside It's Package?

  • Can A Class Be Declared As Protected?

  • What Is The Access Scope Of A Protected Method?

  • What Is The Purpose Of Declaring A Variable As Final?

  • What Is The Impact Of Declaring A Method As Final?

  • I Don't Want My Class To Be Inherited By Any Other Class. What Should I Do?

  • Can You Give Few Examples Of Final Classes Defined In Java Api?

  • How Is Final Different From Finally And Finalize?

  • Can A Class Be Declared As Static?

  • When Will You Define A Method As Static?

  • What Are The Restriction Imposed On A Static Method Or A Static Block Of Code?

  • I Want To Print "hello" Even Before Main Is Executed. How Will You Acheive That?

  • What Is The Importance Of Static Variable?

  • Can We Declare A Static Variable Inside A Method?

  • What Is An Abstract Class And What Is It's Purpose?

  • Can A Abstract Class Be Declared Final?

  • What Is Use Of A Abstract Variable?

  • Can You Create An Object Of An Abstract Class?

  • Can A Abstract Class Be Defined Without Any Abstract Methods?

  • Class C Implements Interface I Containing Method M1 And M2 Declarations. Class C Has Provided Implementation For Method M2. Can I Create An Object Of Class C?

  • Can A Method Inside A Interface Be Declared As Final?

  • Can An Interface Implement Another Interface?

  • Can An Interface Extend Another Interface?

  • Can A Class Extend More Than One Class?

  • Why Is An Interface Be Able To Extend More Than One Interface But A Class Can't Extend More Than One Class?

  • Can An Interface Be Final?

  • Can A Class Be Defined Inside An Interface?

  • Can An Interface Be Defined Inside A Class?

  • What Is A Marker Interface?

  • Which Oo Concept Is Achieved By Using Overloading And Overriding?

  • If I Only Change The Return Type, Does The Method Become Overloaded?

  • Why Does Java Not Support Operator Overloading?

  • Can We Define Private And Protected Modifiers For Variables In Interfaces?

  • What Is Externalizable?

  • What Modifiers Are Allowed For Methods In An Interface?

  • What Is A Local, Member And A Class Variable?

  • What Is An Abstract Method?

  • What Value Does Read() Return When It Has Reached The End Of A File?

  • Can A Byte Object Be Cast To A Double Value?

  • What Is The Difference Between A Static And A Non-static Inner Class?

  • What Is An Object's Lock And Which Object's Have Locks?

  • What Is The % Operator?

  • When Can An Object Reference Be Cast To An Interface Reference?

  • Which Class Is Extended By All Other Classes?

  • Which Non-unicode Letter Characters May Be Used As The First Character Of An Identifier?

  • What Restrictions Are Placed On Method Overloading?

  • What Is Transient Variable?

  • What Is Collection Api?

  • What Is Casting?

  • What Is The Return Type Of A Program's Main() Method?

  • If A Variable Is Declared As Private, Where May The Variable Be Accessed?

  • What Do You Understand By Private, Protected And Public?

  • What Is Downcasting ?

  • What Modifiers May Be Used With An Inner Class That Is A Member Of An Outer Class?

  • How Many Bits Are Used To Represent Unicode, Ascii, Utf-16, And Utf-8 Characters?

  • What Restrictions Are Placed On The Location Of A Package Statement Within A Source Code File?

  • What Is A Native Method?

  • What Are Order Of Precedence And Associativity, And How Are They Used?

  • Can An Anonymous Class Be Declared As Implementing An Interface And Extending A Class?

  • What Is The Range Of The Char Type?

  • What Is The Range Of The Short Type?

  • Why Isn't There Operator Overloading?

  • What Does It Mean That A Method Or Field Is "static"?

  • Is Null A Keyword?

  • Which Characters May Be Used As The Second Character Of An Identifier,but Not As The First Character Of An Identifier?

  • Is The Ternary Operator Written X : Y ? Z Or X ? Y : Z ?

  • How Is Rounding Performed Under Integer Division?

  • If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?

  • Does A Class Inherit The Constructors Of Its Superclass?

  • Name The Eight Primitive Java Types.

  • What Restrictions Are Placed On The Values Of Each Case Of A Switch Statement?

  • What Is The Difference Between A While Statement And A Do Statement?

  • What Modifiers Can Be Used With A Local Inner Class?

  • When Does The Compiler Supply A Default Constructor For A Class?

  • If A Method Is Declared As Protected, Where May The Method Be Accessed?

  • What Are The Legal Operands Of The Instanceof Operator?

  • Are True And False Keywords?

  • What Happens When You Add A Double Value To A String?

  • What Is The Diffrence Between Inner Class And Nested Class?

  • Can An Abstract Class Be Final?

  • What Is Numeric Promotion?

  • What Is The Difference Between A Public And A Non-public Class?

  • To What Value Is A Variable Of The Boolean Type Automatically Initialized?

  • What Is The Difference Between The Prefix And Postfix Forms Of The ++ Operator?

  • What Restrictions Are Placed On Method Overriding?

  • What Is A Java Package And How Is It Used?

  • What Modifiers May Be Used With A Top-level Class?

  • What Is The Difference Between An If Statement And A Switch Statement?

  • Can A Method Be Overloaded Based On Different Return Type But Same Argument Type ?

  • What Happens To A Static Var That Is Defined Within A Method Of A Class ?

  • How Many Static Init Can You Have ?

  • What Is The Difference Between Method Overriding And Overloading?

  • What Is Constructor Chaining And How Is It Achieved In Java ?

  • What Is The Difference Between The Boolean & Operator And The && Operator?

  • Which Java Operator Is Right Associative?

  • Can A Double Value Be Cast To A Byte?

  • What Is The Difference Between A Break Statement And A Continue Statement?

  • Can A For Statement Loop Indefinitely?

  • To What Value Is A Variable Of The String Type Automatically Initialized?

  • What Is The Difference Between A Field Variable And A Local Variable?

  • How Are This() And Super() Used With Constructors?

  • What Does It Mean That A Class Or Member Is Final?

  • What Does It Mean That A Method Or Class Is Abstract?

  • Can An Anonymous Class Be Declared As Implementing An Interface And Extending A Class?

  • What Is The Catch Or Declare Rule For Method Declarations?

  • What Are Some Alternatives To Inheritance?

  • What Are The Different Identifier States Of A Thread?

  • What Is Garbage Collection? What Is The Process That Is Responsible For Doing That In Java?

  • What Kind Of Thread Is The Garbage Collector Thread?

  • What Is A Daemon Thread?

  • How Will You Invoke Any External Process In Java?

  • What Is The Finalize Method Do?

  • What Is Mutable Object And Immutable Object?

  • What Is The Basic Difference Between String And Stringbuffer Object?

  • What Is The Purpose Of Void Class?

  • What Is Reflection?

  • What Is The Base Class For Error And Exception?

  • What Is The Byte Range?

  • What Is The Implementation Of Destroy Method In Java.. Is It Native Or Java Code?

  • What Are The Approaches That You Will Follow For Making A Program Very Efficient?

  • What Is A Databasemetadata?

  • What Is Locale?

  • How Will You Load A Specific Locale?

  • What Is Jit And Its Use?

  • Is Jvm A Compiler Or An Interpreter?

  • What Is The Purpose Of Assert Keyword Used In Jdk1.4.x?

  • How Will You Get The Platform Dependent Values Like Line Separator, Path Separator, Etc., ?

  • Is "abc" A Primitive Value?

  • What Is Singleton?

  • Can You Instantiate The Math Class?

  • What Are The Methods In Object?

  • What Is Aggregation?

  • What Is Composition?

  • What Is Inner Class?

  • What Is Nested Class?

  • What Is The Major Difference Between Linkedlist And Arraylist?

  • What Is The Significance Of Listiterator?

  • What Is The Final Keyword Denotes?

  • What Is Skeleton And Stub? What Is The Purpose Of Those?

  • Why Does It Take So Much Time To Access An Applet Having Swing Components The First Time?

  • What Is The Difference Between Instanceof And Isinstance?

  • What Does The "final" Keyword Mean In Front Of A Variable? A Method? A Class?

  • Describe What Happens When An Object Is Created In Java?

  • What Is The Difference Amongst Jvm Spec, Jvm Implementation, Jvm Runtime ?

  • How Does Java Handle Integer Overflows And Underflows?

  • Why Are There No Global Variables In Java?

  • Whats The Difference Between Notify() And Notifyall()?

  • How Can My Application Get To Know When A Httpsession Is Removed?

  • What Interface Must An Object Implement Before It Can Be Written To A Stream As An Object?

  • What Is Your Platform's Default Character Encoding?

  • What An I/o Filter?

  • What Is The Purpose Of Finalization?

  • Which Class Should You Use To Obtain Design Information About An Object?

  • What Is The Purpose Of The System Class?

  • Can We Use The Constructor, Instead Of Init(), To Initialize Servlet?

  • How Can A Servlet Refresh Automatically If Some New Data Has Entered The Database?

  • The Code In A Finally Clause Will Never Fail To Execute, Right?

  • How Many Messaging Models Do Jms Provide For And What Are They?

  • What Information Is Needed To Create A Tcp Socket?

  • What Class.forname Will Do While Loading Drivers?

  • How Many Jsp Scripting Elements Are There And What Are They?

  • What Are Stored Procedures? How Is It Useful?

  • How Do I Include Static Files Within A Jsp Page?

  • Why Does Jcomponent Have Add() And Remove() Methods But Component Does Not?

  • How Can I Implement A Thread-safe Jsp Page?

  • What Is The Difference Between Procedural And Object-oriented Programs?

  • What Are Encapsulation, Inheritance And Polymorphism?

  • What Is The Difference Between Assignment And Initialization?

  • What Is Oops?

  • What Are Class, Constructor And Primitive Data Types?

  • What Is An Object And How Do You Allocate Memory To It?

  • What Is The Difference Between Constructor And Method?

  • What Are Methods And How Are They Defined?

  • What Is The Use Of Bin And Lib In Jdk?

  • How Many Ways Can An Argument Be Passed To A Subroutine And Explain Them?

  • What Is The Difference Between An Argument And A Parameter?

  • How Would You Implement A Thread Pool?

  • What Are The Advantages And Disadvantages Of Reference Counting In Garbage Collection?

  • Why Java Is Said To Be Pass-by-value ?

  • What Are The Access Modifiers Available In Java?

  • What Is The Difference Between A Switch Statement And An If Statement?

  • What Are Synchronized Methods And Synchronized Statements?

  • What Are The Different Ways In Which A Thread Can Enter Into Waiting State?

  • What Is The Difference Between Static And Non Static Variables ?

  • What Is The Difference Between Notify And Notifyall Method?

  • What Are Different Type Of Exceptions In Java?

  • Explain About The Select Method With An Example?

  • Can There Be An Abstract Class With No Abstract Methods In It?

  • Can We Define Private And Protected Modifiers For Variables In Interfaces?

  • What Is Garbage Collection? What Is The Process That Is Responsible For Doing That In Java?

  • Can There Be An Abstract Class With No Abstract Methods In It?

  • Can An Interface Have An Inner Class?

  • What Is User Defined Exception?

  • What Is The Difference Between Logical Data Independence And Physical Data Independence?

  • What Are The Practical Benefits, If Any, Of Importing A Specific Class Rather Than An Entire Package (e.g. Import Java.net.* Versus Import Java.net.socket)?

  • How Many Methods Do U Implement If Implement The Serializable Interface?

  • What Does The "abstract" Keyword Mean In Front Of A Method? A Class?

  • You Can Create A String Object As String Str = "abc"; Why Cant A Button Object Be Created As Button Bt = "abc";? Explain

  • Can Rmi And Corba Based Applications Interact ?

  • What Is Passed By Reference And Pass By Value ?

  • What Is A "stateless" Protocol ?

  • Difference Between A Class And An Object ?

  • What Are The Four Corner Stones Of Oop?

  • What Gives Java It's "write Once And Run Anywhere" Nature?

  • How Can A Dead Thread Be Restarted?

  • What Happens If An Exception Is Not Caught?

  • What Is A Compilation Unit?

  • What Is A Task's Priority And How Is It Used In Scheduling?

  • What Value Does Readline() Return When It Has Reached The End Of A File?

  • Can An Object's Finalize() Method Be Invoked While It Is Reachable?

  • Does Garbage Collection Guarantee That A Program Will Not Run Out Of Memory?

  • Is Sizeof A Keyword?

  • What State Does A Thread Enter When It Terminates Its Processing?

  • Can A Lock Be Acquired On A Class?

  • How Are Observer And Observable Used?

  • What Is A Transient Variable?

  • Wha Is The Output From System.out.println("hello"+null); ?

  • What Are E And Pi?

  • If An Object Is Garbage Collected, Can It Become Reachable Again?

  • Can An Exception Be Rethrown?

  • What Is The Purpose Of The File Class?

  • Is A Class Subclass Of Itself?

  • What Modifiers May Be Used With An Interface Declaration?

  • What Classes Of Exceptions May Be Caught By A Catch Clause?

  • What Is The Difference Between The Reader/writer Class Hierarchy And The Inputstream/outputstream Class Hierarchy?

  • Can An Object Be Garbage Collected While It Is Still Reachable?

  • What Is An Object's Lock And Which Object's Have Locks?

  • How Are Commas Used In The Intialization And Iteration Parts Of A For Statement?

  • What Must A Class Do To Implement An Interface?

  • What Is The Difference Between Preemptive Scheduling And Time Slicing?

  • What Restrictions Are Placed On The Location Of A Package Statement Within A Source Code File?

  • What Are Wrapped Classes?

  • Is It Possible To Specify Multiple Jndi Names When Deploying An Ejb?

  • What Is Java And Their Uses?

  • What Is Hotjava?

  • How Can You Say Java Is Object Oriented?

  • Why Java Is Platform Independent? Explain.

  • Why Java Is Secure? Explain.

  • Why Do People Says "java Is Robust"?

  • How Java Is Similar To C?

  • What's The Difference Between Applets And Standalone Program?

  • Why Java Applets Are More Useful For Intranets As Compared To Internet?

  • How Can You Set The Applet Size?

  • How Can You Set An Applet's Height And Width As A Percentage?

  • What Is Codebase?

  • What Is Appletviewer?

  • Explain, Java Is Compatible With All Servers But Not All Browsers?

  • What Is The Program Development Process?

  • What Is The File Type?

  • What Is Javac_g?

  • How To Optimize The Javac Output?

  • What Is The Difference Between Java Applets And Applications?

  • Can You Explain The Cs Option Of Java Interpreter?

  • What Is The Statements?

  • What Is Style And Indentation?

  • What Is The Program Compilation Process?

  • What Is Java Literals?

  • What Is The Primitive Type Byte?

  • What Is The Primitive Type Short?

  • Why Call By Value Prevents Parameter Value Change?

  • What Is Remote Method Invocation (rmi)?

  • What Is Java Jit Compilers?

  • What Is The Java Idl System?

  • What Is Java Beans?

  • What Is Object-oriented Programming?

  • What Is Abstraction?

  • What Is Encapsulation?

  • How Does The Application Server Handle The Jms Connection?

  • What Is A Superclass?

  • Explain The Abstract Class Modifier?

  • What Is The Final Class Modifier?

  • Explain The Public Class Modifier.

  • What Is The Public Field Modifier?

  • Explain The Private Field Modifier?

  • Explain The Protected Field Modifier?

  • Can You Explain The Private Protected Field Modifier?

  • What Is The Static Field Modifier?

  • What Is The Final Field Modifier?

  • Explain The Transient Field Modifier?

  • Explain The Use Of Volatile Field Modifier?

  • What Is Default Constructors?

  • What Is The Public Method Modifier?

  • What Is The Private Method Modifier?

  • What Is The Protected Method Modifier?

  • Explain The Private Protected Method Modifier?

  • Can You Explain The Final Method Modifier?

  • What Is The Abstract Method Modifier?

  • What Is The Synchronized Method Modifier?

  • Explain The Init Method?

  • What Is The Destroy Method?

  • What Is Multithreading?

  • How Java Uses The String And Stringbuffer Classes?

  • What Is The Epoch Date?

  • What Is An Arrays?

  • What Is Binary Search?

  • Can A Private Method Of A Superclass Be Declared Within A Subclass?

  • What Is Quick Sort?

  • What Is The Difference Between Final, Finally And Finalize?

  • In System.out.println( ), What Is System, Out And Println?

  • What Is Meant By "abstract Interface"?

  • What Is The Difference Between Swing And Awt Components?

  • Why Java Does Not Support Pointers?

  • What Are Parsers? Dom Vs Sax Parser.

  • What Is A Platform?

  • What Is The Main Difference Between Java Platform And Other Platforms?

  • What Is The Java Virtual Machine?

  • What Is The Java Api?

  • What Is The Package?

  • What Is Native Code?

  • Is Java Code Slower Than Native Code?

  • What Is The Serialization?

  • How To Make A Class Or A Bean Serializable?

  • How Many Methods Are There In The Serializable Interface?

  • How Many Methods Are There In The Externalizable Interface?

  • Which Containers Use A Border Layout As Their Default Layout?

  • What Is Synchronization And Why Is It Important?

  • What Are Three Ways In Which A Thread Can Enter The Waiting State?

  • What Is The Preferred Size Of A Component?

  • Can Java Object Be Locked Down For Exclusive Use By A Given Thread?

  • Can Each Java Object Keep Track Of All The Threads That Want To Exclusively Access It?

  • What Is The Purpose Of The Wait(), Notify() And Notifyall() Methods?

  • What Are The High-level Thread States?

  • What Is The Collections Api?

  • What Is The List Interface?

  • How Many Bits Are Used To Represent Unicode, Ascii, Utf-16 And Utf-8 Characters?

  • What Is The Properties Class?

  • What Is The Purpose Of The Runtime Class?

  • What Is The Purpose Of The Finally Clause Of A Try-catch-finally Statement?

  • What Is The Locale Class?

  • What Is A Protected Method?

  • What Is A Static Method?

  • What Is The Difference Between A Window And A Frame?

  • What Are Peerless Components?

  • What Is The Difference Between The Reader/writer Class Hierarchy And The Inputstream/outputstream Class Hierarchy?

  • What Is The Difference Between Throw And Throws Keywords?

  • Name Primitive Java Types?

  • How Can A Gui Component Handle Its Own Events?

  • What Advantage Do Java's Layout Managers Provide Over Traditional Windowing Systems?

  • What Are The Problems Faced By Java Programmers Who Don't Use Layout Managers?

  • What Is The Difference Between Static And Non-static Variables?

  • What Is The Difference Between The Paint() And Repaint() Methods?

  • What Is A Container In A Gui?

  • Is Iterator A Class Or Interface? What Is Its Use?

  • How You Can Force The Garbage Collection?

  • Describe The Principles Of Oops?

  • Explain The Encapsulation Principle?

  • Explain The Inheritance Principle?

  • How To Define An Abstract Class?

  • How To Define An Interface?

  • Explain The Polymorphism Principle?

  • Explain The Different Forms Of Polymorphism?

  • What Are Access Specifiers Available In Java?

  • What Do You Understand By A Variable?

  • What Do You Understand By Numeric Promotion?

  • Differentiate Between A Class And An Object.

  • What Is The Use Of Object And Class Classes?

  • What Do You Understand By Casting In Java Language?

  • What Are The Types Of Casting?

  • What Do You Understand By Downcasting?

  • What Do You Understand By Final Value?

  • What Are Keyboard Events?

  • What Is The Intersection And Union Methods?

  • What Are Controls And Their Different Types In Awt?

  • What Is The Difference Between Choice And List?

  • What Is The Difference Between Scrollbar And Scrollpane?

  • Which Containers Use A Flow Layout As Their Default Layout?

  • What Are Wrapper Classes?

  • What Is The Difference Between Set And List?

  • How Can The Checkbox Class Be Used To Create A Radio Button?

  • Which Textcomponent Method Is Used To Set A Textcomponent To The Read-only State?

  • What Methods Are Used To Get And Set The Text Label Displayed By A Button Object?

  • What Is The Difference Between Yield() And Sleep()?

  • How To Handle A Web Browser Resize Operation?

  • Explain The Concept Of Hashtables?

 

Top