Monday, April 9, 2012

Different ways to create objects in Java

This is a trivia. Yeah, it’s a bit tricky question and people often get confused. I had searched a lot to get all my doubts cleared.
There are four different ways (I really don’t know is there a fifth way to do this) to create objects in java:
1. Using new keyword
This is the most common way to create an object in java. I read somewhere that almost 99% of objects are created in this way.
MyObject object = new MyObject();
2. Using Class.forName()
If we know the name of the class & if it has a public default constructor we can create an object in this way.
MyObject object = (MyObject) Class.forName("subin.rnd.MyObject").newInstance();
 3. Using clone()
The clone() can be used to create a copy of an existing object.
MyObject anotherObject = new MyObject(); 
MyObject object = anotherObject.clone();
4. Using object deserialization
Object deserialization is nothing but creating an object from its serialized form.
ObjectInputStream inStream = new ObjectInputStream(anInputStream ); 
MyObject object = (MyObject) inStream.readObject();
Now you know how to create an object. But its advised to create objects only when it is necessary to do so.

Saturday, April 7, 2012

Finding Second largest number in an Array

Below given is the Java code example to find second largest element in an array.

1. Using two temporary variable.

Class SecondLargest{
public static void main(String[] args){
int array[] = {5, 3, 2, 1, 4};
max1 = max2 = array[0];
for(int i = 1; i if ( array[i] > max1 ) {
max2 = max1;
max1 = array[i];
}else if ( array[i] > max2 && array[i] < max1 ){
max2 = array[i];
}
System.out.println("Second largest No. : " + max2);
}

2. Sorting
We can sort the array in descending order. The second largest element will be second element in the array.

3. Bubbling through the array twice.
We can use the bubble sort algrithm to sort the array in descending order, but instead of running the complete bubble sort algorithm we bubble just twice through the array, hence bringing the second largest element to the second position in the array.

Compiled Languages vs Interpreted languages

A compiled language is one where you have to compile the source code before it can be executed. The compilation process transforms the source code into machine executable code, which is stored in a separate file. The machine executable code is invoked to actually run the application. Thus in compiled language the source code needs to be compiled before it can be executed. Eg. C, C++

An interpreted language is one where you can execute the source code directly without compilation, by the help of an interpreter. The interpreter reads the source code and executes. Eg. Php, Perl, Python

Compiled programs generally run faster than interpreted ones because interpreted ones must be reduced to machine instructions at runtime. However, it is easier to develop applications in an interpreted environment as you don't have to recompile the source code each time to test it.

Where does Java come?
Java is both compiled and interpreted language. The source code is first compile and converted to byte code - which is stored in .class files. The byte code is then interpreted by the JVM during execution time.

What are JIT compilers?
JIT stands for Just-In-Time compiler. They are used in interpreters (specially in Java VM) to improve the runtime performance. They convert the byte code into native instructions before executing them, so that they can take full advantage of underlying architecture.

why wait and notify methods are in Object class not in thread?

These two links provide the most comprehensive explaination for this question:

http://geekexplains.blogspot.com/2009/10/why-waitnotify-and-notifyall-in-object.html

http://javaqna.wordpress.com/2008/07/07/why-wait-and-notify-methods-are-in-object-class-not-in-thread/

X-----X

Below are some snippets from the above links:-

1. Java concurrency model uses locks to implement mutually exclusive access to objects in a multi-threaded environment and locks are associated with every object in Java not only with threads.

2. wait, notify/notifyAll methods are used by threads to communicate with each other while trying to access a common object. Putting it differently, objects become a medium via which threads communicate with each other.

3. Evidently you see that these three methods are essentially object-related and not thread-related and hence the designers of Java language considered it wise to put them in Object class instead of putting them in Thread class.

4. The usage of the 'object' is the particular object's prerogative and not that of the required threads. Putting these three methods in the Object class helps the objects owning/controlling their usage in a better way ...

5. the communication among the interested threads becomes far too easier when the control is kept at the object's level - one common shared resource/medium and all interested threads communicating via it.

Marker Interface in Java: what, why, uses, etc.

Why is Java not a pure Object based language

The most satisfying answer to this question is :

Java supports primitive datatypes such as int, float, double etc which are not objects. Hence Java is not pure Object based language.

Also, Java has static fields and method which are not part of any object.

Can we clone a Singleton object?

This might seem a tricky question, can we use object.clone() to create a new object of the class and break our Singleton pattern.

Well the answer to this is NO.

The clone method has protected access on the Object class - meaning it is available in the Object class and to the extending classes (which is our Singleton class). Thus any attempt to invoke clone() method on any object will give compile time exception.

This is illegal:-
SingletonClass instance = SingletonClass.getInstance();
SingletonClass newInstance = (SingletonClass)instance.clone();

Hence to create a clone of an object, the object must override the clone() method of the Object class. Thus our SingletonClass can only be cloned if it explicitly implements the clone() method.

How many different types of JDBC drivers are present?

Type 1: JDBC-ODBC Bridge plus ODBC Driver: The first type of JDBC driver is the JDBC-ODBC Bridge. It is a driver that provides JDBC access to databases through ODBC drivers. The ODBC driver must be configured on the client for the bridge to work. This driver type is commonly used for prototyping or when there is no JDBC driver available for a particular DBMS.

Type 2: Native-API partly-Java Driver: The Native to API driver converts JDBC commands to DBMS-specific native calls. This is much like the restriction of Type 1 drivers. The client must have some binary code loaded on its machine. These drivers do have an advantage over Type 1 drivers because they interface directly with the database.

Type 3: JDBC-Net Pure Java Driver: The JDBC-Net drivers are a three-tier solution. This type of driver translates JDBC calls into a databaseindependent network protocol that is sent to a middleware server. This server then translates this DBMSindependent protocol into a DBMS-specific protocol, which is sent to a particular database. The results are then routed back through the middleware server and sent back to the client. This type of solution makes it possible to implement a pure Java client. It also makes it possible to swap databases without affecting the client.

Type 4: Native-Protocol Pur Java Driver: These are pure Java drivers that communicate directly with the vendor's database. They do this by converting JDBC commands directly into the database engine's native protocol. This driver has no additional translation or middleware layer, which improves performance tremendously.

What are wrapper classes?

Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g. a boolean data type can be represented as a Boolean class instance. All of the primitive wrapper classes in Java are immutable i.e. once assigned a value to a wrapper class instance cannot be changed further.

Wrapper Classes are used broadly with Collection classes in the java.util package and with the classes in the java.lang.reflect reflection package.

HashMap Vs HashTable

Both provide key-value access to data. The Hashtable is one of the original collection classes in Java. HashMap is part of the new Collections Framework, added with Java 2, v1.2.

The key difference between the two is that access to the Hashtable is synchronized (by default) while access to the HashMap isn't.

Another difference is that iterator in the HashMap is fail-safe while the iterator for the Hashtable isn't. If you change the map while iterating, you'll know.

And, a third difference is that HashMap permits null values in it, while Hashtable doesn't.

whats the difference between concat and append?

Concat is used to add a string at the end of another string.But append() is used with String Buffer to append character sequence or string.

When we concatinate a string with another string a new string object is created. But in case of StringBuffer append() that is not the case.

Difference between instanceof and isInstance() ?

First difference:


instanceof is a reserved word of Java, but isInstance() is a method of java.lang.Class.


Other differences:

you could use instanceof on types (which are known on compile time), and isInstance() could only be called on an instance fo java.lang.Class.

if (obj instanceof MyType) {
...
}

if (MyType.class.isInstance(obj)) {
...
}

so you can have dynamism using isInstane() like this:

Class x = Integer.class;

if (x.isInstance(obj)) {
...
}

x = String.class;

if (x.isInstance(obj)) {
...
}

as you see you could check the type of an object with an unknown class during compile time!

Serializable Vs Externalizable in Java

JVM vs JRE

Technically, the term "JVM" specifies the Java Virtual Machine. I.e., the "JVM" is the definition of the abstract, stack-based computational engine used to execute Java bytecodes. The term "JRE" stands for the Java Runtime Environment (if you follow Sun's nomeclature) or, interchangeably,Java Runtime Engine. I.e., a JRE is a specific implementation of the the JVM, including the core libaries. 

Alas, in practice, many people use "JVM" for both cases. So, be careful to understand the context that people are talking about when using the term "JVM" to distinguish between the abstract definition and a specific implementation. 


The Java Virtual Machine forms part of a large system, the Java Runtime Environment (JRE). Each operating system and CPU architecture requires a different JRE. The JRE comprises a set of base classes, which are an implementation of the base Java API, as well as a JVM. The portability of Java comes from implementations on a variety of CPUs and architectures. Without an available JRE for a given environment, it is impossible to run Java software.

Refer this link for more details:-
http://www.javacoffeebreak.com/articles/inside_java/insidejava-jan99.html 

http://www.javabeat.net/qna/67-wat-is-the-difference-between-jrejvm-and-jdk/

Can we override a static method ?

We can not override a static method.

Static method are associated with class and not the object, hence inheritance does not apply to static methods. Even though we can write a static method in the child class with same signature as the parent class but it will not be counted as overriding as a reference of the Parent class will always invoke the static method of the Parent class.

Example:

ClassA a = new ClassB();
a.someStaticMethod();

This type of method invocation will always invoke the definition in the parent class, and not the object instance of ClassB. Hence the two methods will exist separately.

Iterator in HashTable Vs Iterator inHashMap

Hash table based implementation of the Map interface. This implementation provides all of the optional map operations, and permits null values and the null key. (The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.) This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time.




The iterators returned by all of this class's "collection view methods" are fail-fast: if the map is structurally modified at any time after the iterator is created, in any way except through the iterator's own remove or add methods, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.



Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs.

What happens when thread is not able to aquire lock?

If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.

Thread yield() vs sleep()

yield() tells the JVM Thread Scheduler that it's OK to give other threads time slices. Usually the JVM uses this call to activate another thread of the same thread priority. In a good preemptive multithreading environment, yield() is a no-op. However, it is important in a cooperative multithreading environment, since without yield(), one thread can eat up all of the CPU.
sleep(x) tells the JVM Thread Scheduler to actively put this thread to sleep and not run it again until at least x milliseconds have elapsed.

Neither sleep() nor yield() change anything about the status of synchronization locks. If your thread has a lock, and you call sleep(1000), then at least a second will elapse before your thread wakes up. When it wakes up it may decide to release the lock -- or it may hold on to it longer.

What is the difference between "green" threads and "native" threads?

Both green and native threads are mechanisms to support multithreaded execution of Java programs. Some JDK distributions (such as Blackdown's) include the option to run with either type of threading.



Native threads use the operating system's native ability to manage multi-threaded processes - in particular, they use the pthread library. When you run with native threads, the kernel schedules and manages the various threads that make up the process.



Green threads emulate multithreaded environments without relying on any native OS capabilities. They run code in user space that manages and schedules threads; Sun wrote green threads to enable Java to work in environments that do not have native thread support.


There are some important differences between using the two in a Linux environment:


Native threads can switch between threads pre-emptively, switching control from a running thread to a non-running thread at any time. Green threads only switch when control is explicitly given up by a thread (Thread.yield(), Object.wait(), etc.) or a thread performs a blocking operation (read(), etc.).



On multi-CPU machines, native threads can run more than one thread simultaneously by assigning different threads to different CPUs. Green threads run on only one CPU.


Native threads create the appearance that many Java processes are running: each thread takes up its own entry in the process table. One clue that these are all threads of the same process is that the memory size is identical for all the threads - they are all using the same memory.



Unfortunately, this behavior limits the scalability of Java on Linux. The process table is not infinitely large, and processes can only create a limited number of threads before running out of system resources or hitting configured limits.

What is the priority of main thread in Java program?

A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.

Every thread has a priority. Threads with higher priority are executed in preference to threads with lower priority. Each thread may or may not also be marked as a daemon. When code running in some thread creates a new Thread object, the new thread has its priority initially set equal to the priority of the creating thread, and is a daemon thread if and only if the creating thread is a daemon.


When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class). The Java Virtual Machine continues to execute threads until either of the following occurs:


* The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place.

* All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method. 

Can you get a lock on a class?

Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.


You get a lock for the class by declaring the method to be synchronized, but the method also has to be a static method. a static method that is synchronized ensures a class level lock. whereas synchronizing a non-static method gives a lock on the object of that class.

Why Java doesn't allow pointers?

The Java Language the referencing and dereferencing of objects is handled for you automatically. Java does not allow you to manipulate pointers or memory addresses of any kind. It does not allow you to cast object or array references into integers and It does not allow you to do pointer arithmetic. It does not allow you to compute the size in bytes of any primitive type or object. There are two reasons for these restrictions:

Pointers are a notorious source of bugs. Eliminating them simplifies the language and eliminates many potential bugs. Pointers and pointer arithmetic could be used to sidestep Java's run-time checks and security mechanisms. Removing pointers allows Java to provide the security guarantees that it does.

To a C programmer, the lack of pointers and pointer arithmetic may seem an odious restriction in Java. But once you get used to the Java object-oriented programming model, it no longer seems like a serious restriction at all. The lack of pointers does mean that you probably can't do things like write UNIX device drivers in Java (at least not without using native methods written in C). But big deal--most of us never have to do this kind of low-level programming anyway. 

How many JVM could be run on an operating system? If only one, then what is the logical reason?

We can run as many JVM instances as we want on an OS. When ever we start a new java process by invoking java.exe (i.e. java [class-name] ) a new instance of JVM is created. Each java process executes in its separate JVM environment - we can specify different JVM parameter for each process.

If it was not possible to execute more than one JVM instance or in other words if all java processes were made share the same JVM instance, then we would not have been able to specify separate JVM options for every processes.

Also, this provides a security feature for each java process, as it executes in its separate environment controlled by the JVM options provided during its start.

A good example of it is Java RMI. RMI is used for communication between two JVMs. Even on a single machine we need to use RMI to communicate between different java processes, that explains that they are not sharing the same JVM instance.

Now, many people are of the opinion that we can have only one JVM as we can install only one JVM type on an OS. This is same as saying that we can open only one MS-Word document coz we can install only one office suit. (Well, not exactly, we can have multiple office suits installed - in different directories).

Also to say, whenever we do a java install, we do not install a JVM, we either install a JRE or JDK. And we can install multiple JRE/JDK on the same machine and also use them simultaniously run our programs - by providing specific paths during program start.

So, this simply explains that we can have more than one JVM instance running on an OS.

Sunday, March 11, 2012

Economy & employment stats, facts and figures



Following are various stats, facts and figures on the economy and employment in India , picked out of newspapers (mainly Hindustan Times), magazines (mainly India Today), the BBC and various sources on the web. These figures are not meant to be comprehensive lists, but rather statistical trivia or factual snippets. For basic general facts and figures about India as well as several Indian states, please see the Quick Reference popups on the right hand side of this page, or go to the main page of India statistics, facts and figures . For a full list of links to our statistics pages, see theAbout India index or the bottom of the right navigation bar on this page.


The stats on this page are divided into following sections:


Figures on employment
number of regular employees of Indian Railways in 1997: 1,583,614 (standing 
   world record 2004) [GWR]
 - number of people applying for 22,000 jobs advertised by the Indian Railway (2003): 
   740,000
 - planned number of staff of Reuters news agency to work in Bangalore by 2006: 
   1,500 (or 10 % of Reuter's total workforce) [BBC Oct 04]
 - number of Dalits employed to clean toilet pits (& remove night soil) in Bangalore: 
   10,000 - 15,000 estimate [BBC; Sep 2002]
 - working population: 699.9 million [GTF; 2005]
 - domestic workers in India: 14 million [approx 2003]
 - women employed in rural areas: 31 % [approx 2003]
 - women employed in cities: 11 % [approx 2003]
 - people registered as unemployed with 936 employment exchanges: 41.6 million 
   (beginning 2004)
 - * people employed: about 480 million [AT Jan 07] 
 - unemployment in Himachal Pradesh: 120,000 people or 20 % [HT Apr 04]
 - employment in the unorganised sector: 91.39 % of work force [approx 2003]
 - employed in agriculture: 50 % (2003)
 - employment growth in agriculture: 0.01 % (2003) 



 Data on employment in IT & BPO (Business Process Outsourcing)
 - * number of people employed in overall IT industry in India (end 2006): 
   1.3 million directly -- 3 million indirectly [BBC Jan 07]
 - staff employed in ITES-BPO : 2002/03: 171,100 -- 2003/04: 245,100 
   (ITES-BPO: IT enabled Services - Business Process Outsourcing) [GTF; 2005]
 - staff employed in outsourced customer service: 2002/03: 65,000 -- 2003/04: 95,000
   [GTF; 2005]
 - annual employee attrition (staff turnover) in voice based BPO (i.e. outsourced
   call centres):
 up to 70-80% in some voice BPOs [GTF; Jan 2006 
 - * number of people applying at Infosys in Bangalore: 1.4 million in 2006 [BBC Jan 07]
 - * number of workers hired by Infosys in Bangalore per year: 30,000 [BBC Jan 07]
 - * people employed by three major Indian IT firms (Infosys, Wipro, TCS): 
   2006: between 52,000 and 83,000 each-- 2001: between 10,000 and 20,000 each -- 
   1996: between 1,000 and 9,000 each [BBC Jan 07] 
 - * people employed abroad by major IT firms: Wipro: 11,000 -- TCS: 20,000 
   [BBC Jan 07]
 - annual salary hike in IT services 2003: 14% [2004]
 - * levels of pay for legal professionals in India as used in LPO
   (Legal Process Outsourcing):
 10% - 15% of that of US lawyers [DNA May 06] 
 - * standard salary for call centre worker in India: around 1.2 lakh Rs 
   (120,000Rs or 1,600 GBP) per year or 10,000 Rs per year [BBC Jan 07] 
 - call centre salary in Gurgaon (in the state of Haryana, but more considered a
   suburb of Delhi):
 8,000 to 14,000 Rupees per month [2004] 
 - * number of members of WBITSA (West Bengali organisation representing
   IT worker's rights):
 500 [BBC Jan 07]
 - * number of IT workers in West Bengal: 2006: 40,000 (incl. call centre staff) 
   [BBC Jan 07] -- 2004: 20,000 [BBC Oct 04] 
 

Statistics on income, wages, labour force etc
- average per capita income (GNI): 470 US Dollar (2003)
 - average per capita income in Bihar: 4,616 Rupees (approx 80 Euro)
 - official minimum wage in Jammu & Kashmir state: 1,800 Rs per month (or 
   60 Rupees per day, equiv to 1.2 Euro per day) for simple labourer
 - official minimum wage in Himachal Pradesh: 65 Rupees per day (simple labourer)
 - population living on less than 2 USD per day: 41.4 percent [v2020; Apr 2003]
 - average monthly wage: 179 USD [GTF; 2005]
 - India's working age population (15-60 years): 610 million (estimate 2003) 
 - growth of India's labour force: 1.9 % per year [BBC Jul 04]
 - growth of job creation between 1994-2000: 1.07 % per annum
 - estimate of wage increase over the next four decades: 800 % (estimate by IMF) 
   [BBC Jul 04]
 - number of cabin crew working for Air India: 1,600 [BBC, Jan 2006]
 - salary of senior Air Hostess in India: up to 75,000 Rs per month [BBC, Jan 2006]
 - percentage of Air India's cabin crew being overweight or obese: 20 % [BBC, Jan 06]
 - expected increase of passengers in the Indian aviation market: approx 45 million 
   over next 5 years [BBC, Jan 2006]
 - monthly salary of 5 year old Police Officer in Chattisgarh: 2,500 Rs (the boy took
   over the job from his father when he died, responsible for filing and bringing tea)
   [BBC, Sep 2005]
 - number of children working in Tamil Nadu districts of Kanchipuram and
   Thiruvanamalai in silk industry:
 10,000 estimate [BBC; Aug 2005]
 - Indian child labourers: between 10.25 % to 19.90 % of all Indian children aged 9-15 
   [BBC; Aug 2005]  
  

 Indian IT industry & BPO (Business Process Outsourcing) related data
- * contribution to India's GDP by Business Process Outsourcing (BPO): 
   estimated for Financial Year 2007: 5.4% -- Financial Year 2006: 4.8% [FE Jan 07]
 - * exports of BPO services: 2006: 13bn GBP -- expected 2010: 30bn GBP [BBC Jan 07] 
 - * export of software services and IT-BPO in financial year 2006-07 according
   to Nasscom:
 approx 16.3bn GBP (31bn USD) [FE Jan 07] 
 - * increase of world wide share of the global outsourcing market by Indian
   companies:
 within the last 4 years from 0.5% to 7% [BBC Jan 07] 
 - revenue from BPO & call centres in fiscal year 2004-05: 5.2bn USD [c/net; Jun 05]
 - revenue from export of software and services industry in fiscal year 2004-05: 
   17.2bn USD [c/net; Jun 2005]
 - total revenue in software industry in fiscal year 2003-04: 15.9bn USD [GTF; 2005] 
 - export of goods and services of India's IT and outsourcing industries in fiscal
   year 2003-04:
 7 billion GBP [BBC sep 04] 
 - revenue percentage of software industry exports 2003-04: 78% [GTF; 2005]
 - contribution of outsourcing to India's total software exports: 29 % [BBC sep 04]
 - Bangalore's (Karnataka's state capital) revenue from overseas outsourcing: 32 % 
   of India's total overseas outsourcing revenue of 10 bn Euro [BBC Sep 04]
 - * value of shares sold in 1999 by Bangalore based company Infosys: 
   approx 37 million GBP [BBC Jan 07] 
 - * current market value of major IT firms: Infosys: 17 billion GBP -- 
   Wipro: 13bn GBP -- TCS: 13bn GBP (all figures approximately, with exchange rate 
   1.9 USD = 1 GBP) [BBC Jan 07] 
 - * current annual revenue of major IT firms: Infosys: 1.1 billion GBP -- 
   Wipro: 1.2bn GBP -- TCS: 1.6bn GBP (all figures approximately, 
   with exchange rate 1.9 USD = 1 GBP) [BBC Jan 07] 
 - * area of the Infosys campus in Bangalore: 40 acres [BBC Jan 07] 
 - * number of major international companies which have IT operations in
   Bangalore:
 more than 500 [BBC Jan 07] 
 - * concentration of IT sector in Bangalore: 40 percent of the whole of 
   India's IT industry [BBC Jan 07] 
 - * population in Bangalore: estimate for 2015: 10m -- 2006: 6.5m -- 1990: 2.8m -- 
   1970: 1.6m [BBC Jan 07]
 - * expected future share by India of the emerging global KPO market: 70% of 
   the estimated 17bn USD global KPO market (KPO: Knowledge Process 
   Outsourcing) [DNA May 06] 
 

  Statistics on economic growth and GDP in India
- * growth of Indian economy for 2006-07: approx 9% [BBC Jan 07]
 - * growth of Indian economy or GDP (Gross Domestic Product): 2005-06: 9% -- 
   2006-07: 7.4% [DNA Jan 07]
 - * economic growth in the manufacturing and industry sector (2005-06): 
   9.1 percent [DNA Jan 07]
 - * economic growth in the IT and ITES sector: approx 20 percent [DNA Dec 06]
 - * economic growth in the agricultural sector: 6 percent [DNA Jan 07]
 - * percentage of India's GDP coming from services, manufacturing and industry: 
   77 percent [DNA Dec 06]
 - * contribution to India's economy by the nearly 70% of the population living
   off the land:
 23 percent [DNA Dec 06]
 - * Gross Domestic Savings (GDS): 2005-06: 32.4% of GDP -- 2004-05: 31.1% of GDP
 - * yearly foreign investment: 2006: 6.3bn GBP estimate -- 2005: 4.2bn GBP -- 
   2004: 2.1bn GBP [BBC Jan 07]
 - economic growth in 2003:
 about 7 %
 - growth of India's economy in the year 2004 to March: 8.2 % (the country's fastest 
   expansion in 15 years) [BBC Jul 04] 



 Data on government income and spending
- Indian foreign exchange reserves: March 2005: 137.55 bn USD [Rediff; Mar 05] -- 
   mid Dec 2005: 144.05 bn USD -- end Dec 2005: 137.2 bn USD [IInfoLine; Jan 2006]
 - India's Gold reserves end Dec 2005: 5.27 bn USD [IInfoLine; Jan 2006]
 - India forex reserves 2004: over 80 billion Euro (cash + foreign investment)
 - corporate tax rate: 35.88 % [GTF; 2005]
 - VAT tax rate: 12.5 % [GTF; 2005]
 - rate of inflation: 3.8 % [GTF; 2005] -- earlier about 6 % [BBC Jul 04]
 - number of tax payers: 20 million (2 % of the population) [BBC Jul 04]
 - money collected in income tax (per year): more than one trillion rupees (17.6 bn Euro) 
   [BBC Jul 04]
 - lowest rate of income tax: 10 % (at annual income between 50,000 and 60,000 Rs, 
   equiv to 960-1150 Euro) [BBC Jul 04]
 - top rate of income tax: 30 % (at annual income above 150,000 Rs, 
   equiv to 2880 Euro) [BBC Jul 04]
 - increase of government 's gross tax collection for time period April - October 2003: 
   8.89 % up from previous year
 - increase of military spending by government with new budget Jul 04: 18 %, 
   to 770 bn Rs (14.8 bn Euro) [BBC Jul 04]


  Various economic statistics and figures

 - * India's share of global biotech market: approx 1.1% [DNA Jan 07]
 - * revenues generated by the biotech sector: 2006: approx 61bn Rs (1.5bn USD) -- 
   2005: approx 32bn Rs (780m USD) [DNA Jan 07]
 - * number of companies comprising the biotech industry 2006: 280 [DNA Jan 07]
 - percentage of organised retail sector in total retail sales: 3 % [BBC, Oct 2005]
 - number of shopping malls 5 years ago: 0 (no malls, only shopping arcades existed) 
   [BBC, Oct 2005]
 - number of shopping malls functional or under construction in Gurgaon 2004: 8 
   [HT Feb 2004]
 - number of big shopping malls 2005: 100 [BBC, Oct 2005]
 - expected number of big shopping malls 2007: 360 [BBC, Oct 2005]
 - richest Indian according to Forbes list of 587 billionaires 2004: Azim Premji (58th 
   place on list, net worth Feb 04: 5.4 bn Euro; Apr 04: 5.8 bn Euro) [HT Feb 04]
 - number of Indians in the Sunday Times 2004 list of the 1000 richest people in
   Britain:
 29 (of who the richest Indian is No 5 on the list: Steel magnate Lakshmi Mittal, 
   worth 3.5 bn GBP) [HT Apr 04]
 - richest Indian woman: Kiran Mazumdar-Shaw of Biocon (1,887 crore Rs, 
   230 million GBP) [HT Apr 04]
 - average time it will take to get all clearances in Indian bureaucracy to set up a
   new business:
 88 days in India (as compared to 8 days in Singapore and 11 days in 
   Hong Kong) [BBC Jun 04]
 - average time it will take to clear all formalities to close a firm if it becomes
   insolvent:
 more than 11 years in India (as compared to less than 7 months in Singapore 
   and one year in Hong Kong) [BBC Jun 04] 
   

Stats on Indian import, export and domestic market
- * estimated value of the matchmaking and marriage industry: Rs 50,000-80,000 crore 
   (approx 6.25-10 bn GBP) [EB Jan 07]
 - * growth of the matchmaking and marriage industry: 25% per year [EB Jan 07]
 - * number of marriages performed in India: 1 crore (10 million) [EB Jan 07]
 - * minimum spending on weddings: by middle-income family in India: 
   approx Rs 140 lakh (34,000 USD) -- by equivalent American family in the US: 
   approx Rs 100 lakh (26,000 USD) [IND Dec 06] 
 - * value of the online matchmaking industry: 
   financial year 2006-07: expected 90 crore Rs (11.5m GBP) -- 
   financial year 2005-06: estimated 58 crore Rs (7.4m GBP) [EI Jan 07]


 more on online matchmaking industry see e-commerce (Telecom & IT)
 - vehicle export: 221,000 (April - September 2003)
 - cars sold in the month of August 2003: 53,177
 - units sold by motorcycle company Hero Honda in 2003-2004: 2.07 million (with a 
   turnover of 5,997 crore Rs, equiv to 1.15 billion Euro) [HT Apr 2004]
 - India mercury imports: 531 tonnes per annum
 - India's consumption of globally produced mercury: 50 %
 - increase of gold jewellery exports from India from 2003 to 2004: 68 % (to 2 bn Euro 
   a year till Mar 04) [HT May 04]
 - share of US as destination for India's gold jewellery exports: 40 % (2004)
 - India's annual import of scrap metal: 3.65 m metric tonnes (worth 580 million Euro) 
   [BBC Oct 04]
 - number of containers filled with metal scrap arriving in India's ports: 500 containers 
   per day [BBC Oct 04]
 - amount of hazardous and potentially hazardous wastes entering India illegally
   1998-1999:
 100,887 tonnes (acc to Greenpeace) [BBC Sep 2000]