<< < 22 23 24 25 26 27   Sort: Date

Objects are passed by value or by reference?
Objects are passed by value or by reference? Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object .
2013-05-17, 1737👍, 0💬

How is static Synchronization different form non-static synchronization?
How is static Synchronization different form non-static synchronization? When Synchronization is applied on a static Member or a static block, the lock is performed on the Class and not on the Object, while in the case of a Non-static block/member, lock is applied on the Object and not on class. [Tr...
2013-03-19, 1733👍, 0💬

How do I serialize an object to a file?
How do I serialize an object to a file? The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the ObjectOutputStream which is connected to a fileoutputstream. This will save the object to a file.
2013-05-20, 1731👍, 0💬

How can we make a class Singleton
How can we make a class Singleton A) If the class is Serializable class Singleton implements Serializable { private static Singleton instance; private Singleton() { } public static synchronized Singleton getInstance() { if (instance == null) instance = new Singleton(); return instance; } /** If the ...
2013-03-18, 1731👍, 0💬

What are class members and Instance members?
What are class members and Instance members? Any global members(Variables, methods etc.) which are static are called as Class level members and those which are non-static are called as Instance level members.
2013-03-19, 1729👍, 0💬

What are different types of inner classes?
What are different types of inner classes? Nested top-level classes, Member classes, Local classes, Anonymous classes Nested top-level classes- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other top-level class. Any class outside ...
2013-05-13, 1728👍, 0💬

What is a Throughput Collector?
What is a Throughput Collector? The throughput collector is a generational collector similar to the default collector but with multiple threads used to do the minor collection. The major collections are essentially the same as with the default collector. By default on a host with N CPUs, the through...
2013-03-25, 1726👍, 0💬

What are the steps in the JDBC connection?
What are the steps in the JDBC connection? While making a JDBC connection we go through the following steps : Step 1 : Register the database driver by using : Class.forName(" driver classs for that specific database" ); Step 2 : Now create a database connection using : Connection con = DriverManager...
2013-06-15, 1721👍, 0💬

What are tag interfaces?
What are tag interfaces? Tag interface is an alternate name for marker interface.
2013-03-12, 1721👍, 0💬

Can we force Garbage collection?
Can we force Garbage collection? java follows a philosophy of automatic garbage collection, you can suggest or encourage the JVM to perform garbage collection but you can not force it. Once a variable is no longer referenced by anything it is available for garbage collection. You can suggest garbage...
2013-03-22, 1716👍, 0💬

Can an unreachable object become reachable again?
Can an unreachable object become reachable again? An unreachable object may become reachable again. This can happen when the object's finalize() method is invoked and the object performs an operation which causes it to become accessible to reachable objects.
2013-06-17, 1715👍, 0💬

Which methods of Serializable interface should I implement?
Which methods of Serializable interface should I implement? The serializable interface is an empty interface, it does not contain any methods. So we do not implement any methods.
2013-05-20, 1715👍, 0💬

What are synchronized methods and synchronized statements?
What are synchronized methods and synchronized statements? Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized ...
2013-06-18, 1714👍, 0💬

How are this() and super() used with constructors?
How are this() and super() used with constructors? This() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.
2013-06-13, 1705👍, 0💬

What is the difference between a while statement and a do statement?
What is the difference between a while statement and a do statement? A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will alw...
2013-06-12, 1699👍, 0💬

What are synchronized methods and synchronized statements?
What are synchronized methods and synchronized statements? Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized ...
2013-06-13, 1698👍, 0💬

How does a try statement determine which catch clause should be used to handle an exception?
How does a try statement determine which catch clause should be used to handle an exception? When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the e...
2013-06-15, 1690👍, 0💬

<< < 22 23 24 25 26 27   Sort: Date