6.What are the different types Application Context implementation in Spring Framework ?
8.Different types of Scope in Spring ?(Singleton,Prototype.RequestSession.Global-Session]
15.Difference between Programmatic Transactions and Declarative Transactions in Spring ?
What are oops
Collection exception multi threading , jsp , servets
Design patterns and benefits
Single ton patter , abstract pattern, proxy pattern, command pattern, builder pattern
Basic of hibernate : you want you object to crud on to data base , hibernate does it for you
Concurrent programming in java
1. How can you write a loop indefinitely in java
2. What is the difference between yield and sleep
3. What is the difference between pre-emptive and time slicing
q: What is Jvm
a: Jvm is an abstract which provide and runtime environment for java to run on different os
.java is comipled to .class(byte code) which is interpreted to in jvm to run on the given os
What is JDK : Developing an application
What is JRE : Running a developed an application
What are the different type of memeory used by JVM
Class , method , heap, stack ,register , native method stack , string constant pool
Heap is where object is created and stack is where for each thread , if stack is exhausted gives stack overflow error, where as if heap is exhausted you get out of memory error
What is class loader
Class loader is a part of JVM which is used to load classes and interfaces in to jvm
What are the diffent types of classLoader
So when you say java classfilename classloader loads that class into jvm, if its not able to find and load the class it will say classnotfoundException
q:What if you change the order of public static void main(String args[]) [static public void order]
a: no
what if you put final before public static void main (String args[]) will it complie ?
a : yes
q : does the constructor return any thing
a: yes it returns instance of the object
q; can we mark constructor as final
a: no we cant, since constructor are not inherited so we get compile error if we mark it final
q; why main method is static
a; object needs to be created to call object methods so to avoid object creation during application start up we mark then as static
q; what is a static block
a; at the time of class loading static block will be executed, it is executed bore the main method to handle the static variables
q; can we execute a program with out a main method
a; static block is executed at the time of class loading
q what is cloning
a , cloning is the process of creating xact copy of the object by calling clone method on object
q: can we overload main method
a; yes we can over load the main method
q: what is static binding
a associating a function call and its definationation during compile time
q: what is dynamic binding
a; associating a function and def during runtime
1. Can we declare interface method as static
Ans no we get compilation error only public and abstract are permitted : interface deal at object level
2. Can an interface be final
Ans no , interface has tobe implemented
3. Can we define private,protected modifiers for variables in interface
Ans no , they implicitly public and static
4. What is static import
Ans we can acess the static memembers without prefixing classname
5. Base class for error and exception
Ans throwable
6. What is the difference between string builder and string buffer
Ans string buffer is synch and builder is not
Q; what is the diffenrnce between linkedlist and arraylist
List define ordered collection of elements . list interface is implemented by arraylist and linkedlist
Arraylist : adding and reviming is slower , quick access to individual elements so faster access , linkdlist for faster addiding and deletion
Q; java is pass by value or by reference
A ; java is pass by value for primitive types and for objects it reference is copy is passed
Q; examples of marker interfaces
A; cloneable and serializable are marker ; serializable only givies complier and jvm that this object is serializable
Q runnable is marker or not interface
A; has run method
Q; how to sort an arralist
A; java.utill.collections provide sort given list sorts it
Q 8 primitive types in java
Int short byte long char float double Boolean
1. WHAT IS JAVA CLASS FILE
ANS ; compiled .java is .class its an instruction to be interpreted by jvm
2. Why java is called platform independent language
Ans compiled files .class which then can be interpreted on multiple platform .class + os specific jvm
3. What is native keyword in java
To say method is implemented not in java
4.
Super used for ?
Supper used to access members of parent class
5.
This is used for ?
Ans this used to represent instance of current class
Explain Key points on GC
a. Automated memory management in java is through gc : objects created in heap so some are no longer used / no live references so clean them to reclaim memory
b. Only jvm decides when to us gc , you can only suggest using system.gc
c. Before object is gc , eligibility is checked
d. Gc works for memory management if memory in heap exhausted out of memeory error comes if java app runs out of memeory
e. Finalize method run only once object is gc but no gurantee
What is static initialization and instance initialization
Static block is run only once when the class is loaeded whereas instance is initialized whenever a new instance is created
What is unreachable object
Object which has no live refrecne and goes out of scope it become gc eligible
What are the different types of modifier used in inner class
Ans strictfp , public , private ,protected , final,abstract
What is the difference between set and list
Set : unordered /no duplicated / no nulls
Explain servlet chaing
Two or more servlet co operated to serve a single request
What is dif hash map / table
Hash table has no null and synchromised methods
What is iterator
Interface allows to walks throw collection of objects
Explain auto boxing in java
Automatic conversion b/w primitive to their correcponding wrapper class
What is enum type in java
An enum type is a special data type that enable a varable to be a set of predefined constancts
What is wrapper class
Wrapper class is any class that wrapps functionality of another class
What is primitive wrapper class
Wrapper class that wraps or encapsulates primitive data types
What design pattern wrapper class implement
Adapter design pattern
What is the difference between process and thread
Process is a program in execution whereas thread a separate path of execution in a program
Explain different thread states in java
Runnable , running ,wait, block sleep and dead
What is deadlock
When tw thread waiting for each other and cant proess in execution ,
How to avoid deadloack
To order accessing shared varaiable
What is the diference between serialisartion and deserialisation
Process of Writing state of objects to byte stream call serailisation and process of restoring these objects from byte stream
What is the difference b/w java 1.4 and 5
Genereic , autoboxing , enum, static imports
What is variable shadowing
Local variable shadow the instance variable
Can class extends interface
Not class can impliments
Dos java support multiple inheritance
No we cant extend multiple class as casue <> problem but can implement multiple interfaces
What do you mean by void return type
Vid means return ing nothing
Is java compiled or interpreted language
Both
What is the diference b/w yield and sleep
Thread.yield goes to runnable state and sleep goes to waiting state
What is object lock
A object lock is a mechnishm used by threads to obtain syn access to object
What is bean life cycle
Spring is based on ioc so call its container as ioc container , spring beans reside inside the ioc container , spring beans aare nothing but pojo
Their life cycle in container
If bean implimnent beanaware , the factory call setbeanname else if beanfactoryaware cals set beanfactory passing an instance of itself
If any beanpostprocessor associated with bean then processbefore initialization is called before bean properties are set
If init method is specified for bean then it will be called
If bean impliments disposablebean interface then destroy mehd is called
If destroy-method attribute is spefiied that will also be called
What is rmi
Rmi stands for remote method invocation, that allows to invoke method of objects on other server, its object oriented rpc mechanism using internet interORB protocol
What is does is it provides a proxy(rmi stub) method to client as like calling local method and then rmi take on pack and find server ie marshalling/serialisation and on other server rmi takes this call , unpack /desrialises so we need ip and port numbr
Which is more tightly couple ; ihertence or composition
Inheritance as extends so has more info where as compostion only has ref and does nt know composed methds of objects
What is the default value of string
Null
What is the difference between preemtive schdeulling and time slicing
Under ps highest proirity task executes until it goes to wait or dead state or antorht high protiy task comes into existence
A task executes for predefined time and then goes to ready sate and scheduler desides which is next task
What is thread in java
An independent path of execution
ways a thread can enter into waiting state
By sleep method , or waiting for io or by invoking wait on object on syn block
Can a lock be acquired on class
Yes lock can be
What new to stop , suspend and resume methods in 1.2
These has been deprecated
What is the differenece b/w java compiler and jvm
Javac is java comiler and jvm to run it