Tuesday, March 12, 2013

Difference between Set and List in Java

Set:

1. A set represents a collection of elements . Order of the elements may change in the set.
2. Set will not allow duplicate values to be stored.
3. Accessing elements by their index(position number) is not possible in case of sets.
4.Sets will not allow null elements.

List:

1. A List represents ordered collection of elements . List preserves the order of elements in
which they are entered.
2. List will allow duplicate value.
3.Accessing elements by index is possible in lists.
4. Lists allow null elements to be stored.

Sunday, March 10, 2013

Difference between HashMap and Hashtable in Java

HashMap:

1. HashMap object is not synchronized by default.
2. In case of a single thread , using HashMap is faster than the Hashtable.
3. HashMap allows null keys and null values to be stored.
4. Iterator in the HashMap is fail-fast . This means iterator will produce exception if concurrent
updates are made to the HashMap.
5. We can make HashMap object synchronied using synchronizedMap() method as:

Collections.synchronizedMap(new HashMap())

Hashtable:

1. Hashtable object is synchronized by default.
2.In case fo multiple threads , using Hashtable is advisable. With a single thread, Hashtable
becomes slow.
3.Hashtable does not allow null keys or values.
4.Enumeration for the Hashtable is not fail-fast. This means even if concurrent updations
are done to to Hashtable, there will not be any incorrect results produced by the Enumeration.


Saturday, March 9, 2013

Difference between ArrayList and Vector in Java

ArrayList:
---------------
1.Array List object is not synchronized by default.
2.In case of a single thread ,using ArrayList is faster than the vector.
3.ArrayList increases its size every time by 50 percent(half).

4. We can synchronize Arraylist using synchronizedList() mehtod as:

List  l = Collections.SynchronizedList(new ArrayList());

Vector:
--------
1.Vector object is synchronized by default.
2. In case of multiple threads, using Vector is advisable. With a single  thread,
   Vector becomes slow.
3. Vector increases its size every time by doubling it.

Friday, March 8, 2013

difference between sleep() and wait() in Java

Both the sleep() and wait() methods are used to suspend a thread execution for a specified time.
When sleep() is executed inside a synchronized block, the object is still under lock .

When wait() method is executed,it breaks the synchronized block , so that the object lock is removed
and it is available.

Generally , sleep() is used for making a thread to wait for some time.But wait() is used in connection
with notify()  or notifyAll() methods in thread communication.

sleep method present in Thread class, wait method present in Object class.
sleep method is static , wait is non static method

Wednesday, March 6, 2013

About Sachin Ramesh Tendulkar



"Sachin Ramesh Tendulkar"                  
                              God of Cricket

   "Commit all your crimes when Sachin is playing... bcoz even GOD is busy watching at his PLAY! "


Perhaps the most complete batsman and the most worshipped cricketer in the world, Tendulkar holds just about every batting record worth owning in the game Following Sachin Tendulkar records list has been growing every year, and will grow until he plays.
            There are no apparent weaknesses in Tendulkar's game. He can score all around the wicket, off both front foot and back, can tune his technique to suit every condition, temper his game to suit every situation, and has made runs in all parts of the world in all conditions




                                                                                                                *As of on Jan'11


List of 100 Records


1.Highest individual score by a single player – 200*
2.First player to play a record 400 innings
3.Number of consecutive ODI appearances – 190 matches
4.Cricket grounds played on – 90 grounds
5.Record number of matches played – 442 matches6.Most runs in a cricket career – 17,598 runs
7.Record number of ODI centuries – 46 Centuries
8.Record number of centuries in ODIs against an opponent – 9 Centuries
9.Record number of centuries in tournament finals – 6 Centuries
10.Record number of centuries in all formats against an opponent – 19 centuries

11.Record number of Test Centuries - 51 Centuries (More than Half Century Centuries in Test Cricket)
12.First player to score 10,000 runs
13.First player to score 11,000 runs
14.First player to score 12,000 runs
15.First player to score 13,000 runs
16.First player to score 14,000 runs
17.First player to score 15,000 runs
18.First player to score 16,000 runs
19.First player to score 17,000 runs
20.Only male player to score a double century in ODIs
21.Tendulkar has scored more than 1,000 runs against every major cricket playing nation
22.Sachin is the only player to score more than 3000 runs against a single opponent – Sri Lanka and Australia
23.Holds the record to score more than 1,000 runs in a single calender year. He has done this 7 times so far.
24.Most number of runs in tournament finals – 1833 runs
25.Most fours in an innings – 25 against South Africa
26.Record number of scores above 150 in an innings – 5
27.Most Half Centuries in ODIs – 93 Half Centuries
28.Highest number of scores over 50 – 139
29.Most Man of the Match awards in ODIs – 61
30.Most Man of the Series awards in ODIs – 19

31.Most half centuries in world cup matches – 13
32.Sachin Tendulkar holds the record for the most runs in ODIs in a calendar year – 1894 runs in 1998
33.Second Fastest to reach 8000 test runs. Record recently broken by Kumar Sangakarra
34.Fastest to reach 12,000 test runs
35.Fastest to reach 13,000 test runs
36.Record centuries in a calendar year – 9 centuries in 1998
37.Highest partnership for any ODI wicket – 331 runs with Rahul Dravid
38.Highest partnership for 2nd wicket in ODIs – 331 runs with Rahul Dravid
39.Highest partnership for 3rd wicket in ODIs – 237* runs with Rahul Dravid

40.Highest partnership aggregated by a pair – 8227 runs with Sourav Ganguly
41.Record opening partnership pair – 6609 runs with Sourav Ganguly
42.Most century partnerships – 26 partnerships with Sourav Ganguly
43.4 wickets and Century in the same match – Against Australia in 1998
44.Sachin Tendulkar has been dismissed a record 3 times on 99 in ODIs
45.Sachin has been the most dismissed batsman in the 90s in International cricket – 24
46.Most 200 run partnerships in ODIs – 6
47.Most century partnerships by an opening pair – 21 with Sourav Ganguly
48.Record number of runs in a cricket world cup – 673 runs in 2003

49.Most runs in cricket world cups combined – 1796 runs
50.Most centuries in International cricket – 94 centuries
51.On Sachin’s Debut, he was the second youngest debutant after Aaqib Javed of Pakistan52.First batsman to complete 31,000 International runs
53.Most test runs – 13447 runs
54.Most dismissals in the 90s in ODIs – 17
55.Most number of Test appearances - 169
56.Most fours in test cricket – 1734+
57.Most century partnerships in Tests – 17 with Rahul Dravid
58.Highest score by an Indian captain – 217 against New Zealand
59.More than 1000 test runs in a single calendar year – 5 times

60.Record number of man of the match awards by an Indian in Test matches – 14 times
61.First batsman to score 50 international centuries
62.First batsman to score 60 International centuries
63.Tendulkar holds the record for being the only batsman to score 70 International centuries
64.Tendulkar holds the record for being the only batsman to score 80 International centuries
65.Tendulkar holds the record for being the only batsman to score 90 International centuries
66.Sachin Tendulkar is the only player to have scored century on debut in the Irani trophy, Ranji trophy and Duleep trophy
67.Most Centuriess in World cup Cricket – 4
68.Most Half Centuries in World Cup cricket – 17
69.Most boundaries in International cricket – 3675

70.Most half centuries in International cricket – 149
71.Most runs in a single edition of the IPL – 618 runs
72.Most runs scored in test matches away from home – 7819 runs
73.Highest overall partnership runs, in all formats combined – 12,400 runs with Sourav Ganguly
74.Most matches in a career – 606 matches
75.Sachin Tendulkar has played for a record number of consecutive matches for India – 239 matches
76.Highest partnership for the 3rd wicket in World Cup – 237 runs with Rahul Dravid
77.Fastest to reach 10,000 Test runs
78.Sachin is currently second after Sanath Jayasuriya for the most ODI appearances, soon expected to overtake
79.Sachin Tendulkar scored 5 centuries before he turned 20
80.Most fours in ODI cricket – 1927 boundaries


81.Ranked by Wisden as the Best ODI batsman of all time
82.Ranked by Wisden as the Second Best Test batsman of all time
83.Highest Indian last wicket partnership – 133 runs with Zaheer Khan
84.Most number of Man of the Match awards in World Cup
85.Sachin Tendulkar and Vinod Kambli were involved in a 664 run partnership in Harris Shield game in 1988. A record broken this year
86.In 1992, Sachin became the first overseas player to play for Yorkshire at the age of 19
87.Has the least percentage of Man of the Match awards when on the losing side. Out of the 56 times, India has lost 5 times
88.Sachin has won the Padma Shri, Arjuna Award and Rajiv Gandhi Khel Ratna awards, and he is the only cricketer to receive them all
89.One of the few batsmen to have Centuries against all Test Playing countries
90.The first batsman to be given out by a Third Umpire TV reviewal system
91.Sachin holds the record for being the only player to have 40 wickets and 11000 runs in Test cricket
92.Sachin holds the record for being the only player to have 150 wickets and 15000 runs in ODI cricket

93.Sachin Tendulkar holds the best average amongst the batsman who have crossed 10,000 ODI runs
94.The highest run scorer in the 199 and 2003 cricket world cups
95.Sachin is the only player to have more than 100, fifty plus scores
96.The only batsman to have scored more than 2 centuries against all Test playing nations
97.Sachin has completed his Century by hitting a 6, on four different occasions in test matches, a record shared by Ken Barrington
98.Only cricketer to have done 10,000 runs, 100 wickets and 100 catches in ODIs
99.The only player to be in Top 100 of ICC rankings for 10 years
100.Sachin is the cricketer to have a record number of records.

Take a Bow Master!!!  

Thursday, February 28, 2013

Java and .NET Referal Openings At Infosys

Hi All,

There is scheduled Recruitment drive for Referals who are short-listed on March 16th in across all locations in Infosys.
Please send u r resumes to this id:  sambamca06@gmail.com
Exp Range: 2 to 8 yrs

Note: Please send only genuine profiles.

Wednesday, February 27, 2013

Difference between Abstract class and Interface

Abstract Class
==========
1.An abstract class can have method body (non-abstract methods).
2.An abstract class can have instance variables.
3.An abstract class can have constructor.
4.An abstract class can have static methods.
5.You can extends one abstract class.

ex:
publlic abstract class TxnCommand
{

public abstract void  show();

public void calculate()
{
//Method Implimentatiion;
}

}

Interface
=======
1.Interface have only abstract methods.
2.An interface cannot have instance variables.
3.Interface cannot have constructor.
4.Interface cannot have static methods.
5.You can implement multiple interfaces.

ex:


public
interface CommonCommand
{

public static final int i = 10;
public abstract void  show();

}