Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


asmit
garbage collector
1 Answer(s)      a year and 10 months ago
Posted in : Java Interview Questions


Hi

what is the adventage using system.gc() method ?

what is the adventage f annotation in java ?

how can we loads the spring context file ?

what is advantage of spring framework?

what is the bean definatin in spring?

what is earger loading and lazy loading in hibernate ?


Advertisement
View Answers

September 10, 2012 at 1:45 PM


Advantage of system.gc():

System.gc() runs the Garbage Collector.The JVM performs this recycling of all discarded obj's even if gc is not invoked explicitly.System.gc() is a static method so it is more convenient to use.

Advantages of Annotations:

1)It has made Enterprise Application Development easy.

2)Annotations are generally used to embed in a program data that would otherwise be furnished in a side file. With annotations, you put the specification information right in your code next to the program element that it affects. This is a more intuitive and convenient approach.

3)Annotations typically contain several optional elements to allow detailed customization of an application.

4)One immediate benefit of annotations for web services is that many formerly required markers, such as the extends java.rmi.Remote and throws java.rmi.RemoteException that were borrowed from remote method invocation (RMI), are no longer necessary.

Java EE 5 platform provides annotations for the following tasks:
Defining and using web services
Developing EJB software applications
Mapping Java technology classes to XML
Mapping Java technology classes to databases
Mapping methods to operations
Specifying external dependencies
Specifying deployment information, including security attributes.

Advantage of Spring Framework:

1)Spring is Lightweight container.
2)No App Server Dependent ? like EJB JNDI Calls.
3)Objects are created Lazily , Singleton - configuration
4)Components can added Declaratively.
5)Initialization of properties is easy ? no need to read from properties file.
6)Declarative transaction, security and logging service - AOP
7)application code is much easier to unit test.
8)With a Dependency Injection approach, dependencies are explicit, and evident in constructor or JavaBean properties.
9)Spring's configuration management services can be used in any architectural layer, in whatever runtime environment.
10)Spring can effectively organize your middle tier objects.
11)Not required special deployment steps.

Eager and Lazy loading:

lazy loading means that any foreign key references that you have in you table will be loaded only when referred to by the application. Eager loading means everything will be loaded at once.

Hibernate adopts the mechanism of lazy loading to load objects from databases. Lazy loading contributes a lot to improve the performance of an application by limiting the amount of objects that will be needed.

Eager loading loads the full objects tree once. Because eager loads multiple related objects with a single SELECT statement instead of using multiple SELECT statements, therefore in some situations, eager loads can also improve the performance of the application by reducing the times of accessing the database.



Related Tutorials/Questions & Answers:
Garbage Collector
Garbage Collector  Hi, Can any one please tell me what are the types of garbage collector ?? Regards: Akash
GARBAGE COLLECTOR
GARBAGE COLLECTOR  What is garbage collector in java?   In order to achieve run-time polymorphism in java following supports needed. At first overrides the super-class one or more methods in subclass this is due
Advertisements
garbage collector
garbage collector  Hi what is the adventage using system.gc() method ? what is the adventage f annotation in java ? how can we loads the spring...;Advantage of system.gc(): System.gc() runs the Garbage Collector.The JVM
Java garbage collector
Java garbage collector  What is the priority of Garbage collector thread
Java Garbage collector
Java Garbage collector  What kind of thread is the Garbage collector thread?  Hi Friend, It is a daemon thread. Thanks
Java garbage collector
Java garbage collector  Does garbage collection guarantee that a program will not run out of memory?  Hi, The Java Garbage Collector does not guarantee of this. Thanks
Java garbage collector
Java garbage collector  How you can force the garbage collection
Garbage collector thread - Java Beginners
Garbage collector thread  Hi, Please let me know what kind of thread is the Garbage collector thread? Thanks  Hi Friend, It is a daemon thread. Thanks
Java garbage collector
Java garbage collector  Which is garbage collected first: Normal variables or static variables
garbage collector - Java Interview Questions
garbage collector  what is the use of garbage collector?  Hi friend, import java.util.Vector; public class GarbageDemo{ public...; for (int i = 0; i < size; i++) { } System.out.println("Garbage
garbage collector - Java Interview Questions
How Garbage Collector Works   how does Garbage Collection works?  Garbage Collection in JavaGarbage Collector Garbage collection"... unreferenced objects on the fly. if you want more details about Garbage Collector
Garbage Collector - Java Interview Questions
Garbage Collector  Why Database Connection object is not Garbage Collected? As we need to close the connetion manually, not like with other objects garbage collected
Garbage Collection
; In the example we are describing how the garbage collector works... are creating three objects to give the garbage collector something to do, then we... in milliseconds into a long type variable then calling the garbage collector method
Code for Garbage Collection
to force a garbage collector to work by creating many objects. Description... collection. First of all we have created an object for the garbage collector...(); method to show the time take by the garbage collector
Java garbage collection
Java garbage collection  How many times may an object's finalize() method be invoked by the garbage collector
garbage collection - Java Beginners
then it will be automatically deleted by the garbage collector. It save the some amount..."algorithms.Instead of "destructor" in c++ , java supports garbage collector...garbage collection  wat is the use of garbage collection  
garbage collection in java
will learn how to force a garbage collector to work by creating many objects.... First of all we have created an object for the garbage collector to perform...(); method to show the time take by the garbage collector. import
Garbage collection process in java - Java Beginners
In Java the Garbage collection process is known as Garbage Collector. The Garbage.... Program can call the System.gc() method to call the Garbage Collector...Garbage collection process in java  Name the process used for Garbage
garbage collection
garbage collection  how to use garbage collection in program using core java
What is garbage collection? - Java Beginners
. The Garbage collector is responsible for running the Garbage collection process.... But Garbage collector will finally decide weather to call Garbage collection...What is garbage collection?   Hi, Tell me about garbage collection
Garbage collection
Garbage collection  why garbage collection? How it works?   Garbage collection is one of the most important features of Java. The purpose of garbage collection is to identify and discard objects that are no longer
Java garbage collection
Java garbage collection  What is Garbage Collection and how to call it explicitly
Java Garbage Collection
. The garbage collector determines which objects are no longer referenced... Java Garbage Collection      ... on garbage collection. The name "garbage collection" implies
c++ garbage collection implementation
c++ garbage collection implementation  How to implement the garbage collection program in C
Java garbage collection
Java garbage collection  Can an object be garbage collected while it is still reachable
Java garbage collection
Java garbage collection  Can an unreachable object become reachable again
Getting garbage value
Getting garbage value  Thanks for the reply. Its works well, but whenever I'm using numeric value from 0010 to 0757 it is returning some garbage value. I dont have the idea what is going wrong. Please give me some idea to solve
garbage collection implementation dependent java
garbage collection implementation dependent java  How a garbage collection works in Java
Getting garbage value
Getting garbage value  Thank You Sir for helping me out from the problem. Now I'm facing some problem with the value I'm passing to the textfield from the link gets some garbage value whenever I'm using some particular set
Getting garbage value
Getting garbage value  Thank You Sir for helping me out from the problem. Now I'm facing some problem with the value I'm passing to the textfield from the link gets some garbage value whenever I'm using some particular set
php garbage collection sessions - PHP
php garbage collection sessions  i wanted to know more about the php garbage collection sessions.. how can i create and hold
Java: Garbage Collection
Java: Garbage Collection Garbage collection is the process of automatically finding memory blacks that are no longer being used ("garbage"), and making... running out of memory. Automatic garbage collection When there are no longer
What is the purpose of garbage collection in Java, and when is it used?
What is the purpose of garbage collection in Java, and when is it used?  Hi, What is the purpose of garbage collection in Java, and when is it used... of Garbage collection in Java. so Please visit the link and clear your doubts
Java finalize() Method Example
object which are eligible for garbage collection is to call..., there is no guarantee of running of finalize() method in code. Garbage Collection thread
Finalize Method in Java
Finalize method in Java is a special method called by the garbage collector... is defined under java.lang.Object class. Garbage collection is carried out...() method of all object eligible for garbage collection
Access Modifiers and Garbage Collection
step further in version 2.0 garbage collector is implemented as a conservative collector. This enable users to use full functionality of C as well as preserves... Access Modifiers and Garbage Collection  
java - Java Beginners
java  how tha garbage collector know that the object will be deleted? on which algorithm the garbage collector works? what is the working principle of garbage collector? How manay types of garbage collectors r
PROGRAMMING - Java Interview Questions
utilization of memory garbage collection is used. Garbage collector runs...PROGRAMMING  what are the use of garbage collection?is it automatic process or manual process?  Hi friend . Garbage collection
GARBAGECOLLECTIONS - Java Interview Questions
GARBAGECOLLECTIONS  what are the algorithams of garbage collector?i want answer plz reply?  Hi Friend, Please visit the following link: http://www.roseindia.net/software-tutorials/detail/4657 Thanks
java
is called by the garbage collector on an object when the garbage collector... - declare constant finally - handles exception finalize - helps in garbage collection... in the finalize method will be garbage collected whenever GC is called
About Constructor
of object of string which will create . All are those are eligible for garbage collector + not eligible both. Please Reply ASAP Thank you Ashvin Jain
finalize() method
finalize() method  Can an object's finalize() method be invoked while it is reachable?  An object?s finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object?s
Java Heap
. The garbage collector uses a mechanism to determine which objects are no longer..., the garbage collector must run any finalizers of objects being freed. A garbage... on the heap at run time. Garbage collection is the mechanism of automatically freeing
java - Java Interview Questions
friend, Yes,an unreachable object may become reachable again. The garbage collector finds that object is unreachable,If it can be state of finalize... by Garbage Collector.It can be done by finalize() method. For read more
java
it, for it never existed in the first place. The garbage collector is meant... be garbage collected after line c1 = null; But the total number of objects garbage collected is 2 since the CardBoard class contains one wrapper object Short
Java interview questions and answers
the unused memory by the invalid objects. Garbage collector is responsible for this process 2.What kind of thread is the Garbage collector thread? Ans...Java interview questions and answers   what is garbage collection
OBJECT CLASS - Java Interview Questions
OBJECT CLASS  How To Find Out How many Objects Create?How Many Object Are Reachabule To Garbage Collector?i want Source code Plz Help me........?urgentttttttttttttt  To find the number of objects created
java - Java Beginners
a method finalize()that is usually called by the garbage collector when ensures
PHP Resource Associates
by garbage collector. That's why we do not need to free the memory manually
Core Java Interview Question, Interview Question
objects. The garbage collector must somehow determine which objects are no longer... and can't be forced. We can call garbage collector in Java by calling System.gc... Question: Explain garbage collection ?  Answer: Garbage collection
Advertisements
 

 

 

DMCA.com