Everything Else
Home Up Core java Core Java 2 Everything Else Core Java 3 Java Network Unanswered Questions

 

1.Difference between a process and a thread?
I remember having read this answer somewhere. "Threads are like tiny ropes. A Process would denote a rope made out from these threads." Fun apart, a process can contain multiple threads. Also a process gets its own memory address space while a thread doesn't.

2.What are checked and unchecked exceptions?
Checked exceptions are the ones which you expect beforehand to be raised when an exceptional condition occurs and so write your code in a try-catch block to handle that sufficiently. For example: InsuffucientBalanceException which might be raised when money is being withdrawn from a bank account and the account has insufficient balance. Checked exceptions are sub classes of Exception.

Unchecked exceptions are the ones which cannot be handled in the code. These are rather unexpected exceptions like NullPointerException, OutOfMemoryError, DivideByZeroException, typically, programming errors. Unchecked exceptions are subclasses of RunTimeExceptions.

3.Is synchronised a modifier?indentifier??what is it??
It's a modifier. 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 methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement.

5.What is singleton class? where is it used?
Singleton is a design pattern meant to provide one and only one instance of an object. Other objects can get a reference to this instance through a static method (class constructor is kept private). Why do we need one? Sometimes it is necessary, and often sufficient, to create a single instance of a given class. This has advantages in memory management, and for Java, in garbage collection. Moreover, restricting the number of instances may be necessary or desirable for technological or business reasons--for example, we may only want a single instance of a pool of database connections.

6.Name the null interfacess in java?what are they?
No idea..ranchers come to my rescue..

7.How to avoid deadlock?
 

bulletDon't go to sleep holding a lock
bulletCoordinate thread access to synchronized methods using wait and notify.
 

8.Garbage collection thread belongs to which priority..min?normal?max?The Java garbage collection is implemented as a low priority thread

9.What is meant by time slicing?
Its a task scheduling method. With time slicing, or "Round-Robin Systems", several processes are executed sequentially to completion. Each executable task is assigned a fixed-time quantum called a time slice in which to execute.

10.What is a compilation unit?
The smallest unit of source code that can be compiled, i.e. a .java file.

11.Is string a wrapper class?
String is a class, but not a wrapper class. Wrapper classes like (Integer) exist for each primitive type. They can be used to convert a primitive data value into an object, and vice-versa.

12.how can you retrieve warning in jdbc?
Write my JDBC code in a try-catch block and catch the SQLExcpetions

13.Is there any tool in java that can create reports?
Yes there are third party tools available.

14.What is JTS? Where is it used?
JTS specifies the implementation of a transaction manager which supports the Java Transaction API (JTA) and implements the Java mapping of the Object Management Group (OMG) Object Transaction Service (OTS) specification (at the level below the API).

15.Why java does not have multiple inheritance?
The Java design team strove to make Java:
 

bulletSimple, object oriented, and familiar
bulletRobust and secure
bulletArchitecture neutral and portable
bulletHigh performance
bulletInterpreted, threaded, and dynamic
 

The reasons for omitting multiple inheritance from the Java language mostly stem from the "simple, object oriented, and familiar" goal. As a simple language, Java's creators wanted a language that most developers could grasp without extensive training. To that end, they worked to make the language as similar to C++ as possible (familiar) without carrying over C++'s unnecessary complexity (simple).

In the designers' opinion, multiple inheritance causes more problems and confusion than it solves. So they cut multiple inheritance from the language (just as they cut operator overloading). The designers' extensive C++ experience taught them that multiple inheritance just wasn't worth the headache.

16.Why java is not a 100% oops?

In a 100% Object oriented language, everything is an Object. That is not the case with Java. Java uses primitive types such as int, char, double. Java primitive types ARE NOT OBJECTS.  All the rest are objects. Keep in mind that int, char and other primitive types CAN NOT BE STORED in collections (e.g. Vector, Hashtable) to store these types in a collections, you need to Use wrapper classes (e.g. Integer, Double).

17.What is a resource bundle?
In its simplest form, a resource bundle is represented by a text file containing keys and a text value for each key.

What is meant by resource leak?

Resource leakage generally referrs to memory leakage but can refer to any type of system resource that isn't managed correctly.

Memory leakage refers to memory that is no longer used but is not freed and therefore is not available for the system to reuse. Java is supposed to remove most of the memory leakage issues of other languages but it is still possible to create situations that waste memory such as java.util.Map that you never remove information from.

Resource leakage in a more general sence can refer to any system or external application finite resource. The java.awt.Graphics context is supposed to be like this because in java it is a wrapper on a system resource. If you don't close it, it can't be cleaned up by the system. Database resources are another example. Poor Databse code can prevent connections from being recycled by the DBMS and represent a drag on the database.

 

Search this site for:

 

Please use this form to communicate any issues/problems with this website or its contents. If you find any content inappropriate for any reason, please let me know. Hit Counter