Search This Blog

Sunday 29 June 2014

The type 'Microsoft.SqlServer.Management.Sdk.Sfc.ISfcHasConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.

 I think the error is fairly explanatory, include a reference to Microsoft.SqlServer.Management.Sdk.Sfc. You have not listed that you added that reference. Sometimes when you add references that use other dll reference's that were not included, then you have to include those other references...even if you are not using them.

Friday 27 June 2014

Why multiple inheritance is not supported in Java !!!

Why Java doesn't support multiple inheritance

1) First reason is ambiguity around Diamond problem, consider a class A has foo() method and then B and C derived from A and has there own foo() implementation and now class D derive from B and C using multiple inheritance and if we refer just foo() compiler will not be able to decide which foo() it should invoke. This is also called Diamond problem because structure on this inheritance scenario is similar to 4 edge diamond, see below

           A play()
           / \
          /   \
play() B     C play()
          \   /
           \ /
            D
           play()

In my opinion even if we remove the top head of diamond class A and allow multiple inheritances we will see this problem of ambiguity.

Some times if you give this reason to interviewer he asks if C++ can support multiple inheritance than why not Java. hmmmmm in that case I would try to explain him the second reason which I have given below that its not because of technical difficulty but more to maintainable and clearer design was driving factor though this can only be confirmed by any of java designer and we can just speculate. Wikipedia link has some good explanation on how different language address problem arises due to diamond problem while using multiple inheritances.

2) Second and more convincing reason to me is that multiple inheritances does complicate the design and creates problem during casting, constructor chaining etc and given that there are not many scenario on which you need multiple inheritance its wise decision to omit it for the sake of simplicity. Also java avoids this ambiguity by supporting single inheritance with interfaces. Since interface only have method declaration and doesn't provide any implementation there will only be just one implementation of specific method hence there would not be any ambiguity.

Java Collections - List

The java.util.List interface is a subtype of the java.util.Collection interface. It represents an ordered list of objects, meaning you can access the elements of a List in a specific order, and by an index too. You can also add the same element more than once to a List.
Here is a list of the topics covered in this text:
  1. List Implementations
  2. Adding and Accessing Elements
  3. Removing Elements

List Implementations

Being a Collection subtype all methods in the Collection interface are also available in the List interface.
Since List is an interface you need to instantiate a concrete implementation of the interface in order to use it. You can choose between the following List implementations in the Java Collections API:
  • java.util.ArrayList
  • java.util.LinkedList
  • java.util.Vector
  • java.util.Stack
There are also List implementations in the java.util.concurrent package, but I will leave the concurrency utilities out of this tutorial.
Here are a few examples of how to create a List instance:
List listA = new ArrayList();
List listB = new LinkedList();
List listC = new Vector();
List listD = new Stack();    

Adding and Accessing Elements

To add elements to a List you call its add() method. This method is inherited from the Collection interface. Here are a few examples:
List listA = new ArrayList();

listA.add("element 1");
listA.add("element 2");
listA.add("element 3");

listA.add(0, "element 0");
The first three add() calls add a String instance to the end of the list. The last add() call adds a String at index 0, meaning at the beginning of the list.
The order in which the elements are added to the List is stored, so you can access the elements in the same order. You can do so using either the get(int index) method, or via the Iterator returned by the iterator()method. Here is how:
List listA = new ArrayList();

listA.add("element 0");
listA.add("element 1");
listA.add("element 2");

//access via index
String element0 = listA.get(0);
String element1 = listA.get(1);
String element3 = listA.get(2);


//access via Iterator
Iterator iterator = listA.iterator();
while(iterator.hasNext(){
  String element = (String) iterator.next();
}


//access via new for-loop
for(Object object : listA) {
    String element = (String) object;
}
When iterating the list via its Iterator or via the for-loop (which also uses the Iterator behind the scene), the elements are iterated in the same sequence they are stored in the list.

Removing Elements

You can remove elements in two ways:
  1. remove(Object element)
  2. remove(int index)
remove(Object element) removes that element in the list, if it is present. All subsequent elements in the list are then moved up in the list. Their index thus decreases by 1.
remove(int index) removes the element at the given index. All subsequent elements in the list are then moved up in the list. Their index thus decreases by 1.

Wednesday 11 June 2014

India General (Lok Sabha) Election Results 2014



India General (Lok Sabha) Election Results 2014


* Map Showing the Constituency Wise General Election 2014 Results..

Disclaimer: All efforts have been made to make this image accurate. However  Blogger and Raj do not own any responsibility for the correctness or authencity of the stats.


Party wise General Election Results

AlliancePartyAbbreviationWon Seats
BJP+Bharatiya Janata PartyBJP282
OthersCommunist Party of IndiaCPI1
OthersCommunist Party of India (Marxist)CPM9
INC+Indian National CongressINC44
INC+Nationalist Congress PartyNCP6
OthersAam Aadmi PartyAAP4
OthersAll India Anna Dravida Munnetra KazhagamAIADMK37
BJP+All India N.R. CongressAINRC1
OthersAll India Trinamool CongressAITC34
OthersAll India United Democratic FrontAIUDF3
OthersBiju Janata DalBJD20
OthersIndian National Lok DalINLD2
INC+Indian Union Muslim LeagueIUML2
OthersJammu & Kashmir Peoples Democratic PartyPDP3
OthersJanata Dal (Secular)JD(S)2
OthersJanata Dal (United)JD(U)2
INC+Jharkhand Mukti MorchaJMM2
INC+Kerala Congress (M)KEC(M)1
BJP+Lok Jan Shakti PartyLJP6
BJP+Naga Peoples FrontNPF1
BJP+National Peoples PartyNPP1
BJP+Pattali Makkal KatchiPMK1
INC+Rashtriya Janata DalRJD4
OthersRevolutionary Socialist PartyRSP1
OthersSamajwadi PartySP5
BJP+Shiromani Akali DalSAD4
BJP+ShivsenaSHS18
OthersSikkim Democratic FrontSDF1
OthersTelangana Rashtra SamithiTRS11
BJP+Telugu DesamTDP16
OthersAll India Majlis-E-Ittehadul MuslimeenAIMIM1
BJP+Apna DalAD2
BJP+Rashtriya Lok Samta PartyRLSP3
BJP+Swabhimani PakshaSWP1
OthersYuvajana Sramika Rythu Congress PartyYSRC9
OthersIndependentIND3
Total543

 

State wise General Election Results

StatesTotal SeatsParty 1SeatsParty 2Seats
Andhra Pradesh42TDP+19TRS11
Andaman and Nicobar1BJP1
Arunachal Pradesh2BJP1INC1
Asom (Assam)14BJP7INC+3
Bihar40BJP+31RJD+7
Chandigarh1BJP1
Chhattisgarh11BJP10INC1
Dadra and Nagar Haveli1BJP1
Daman and Diu1BJP1
Delhi7BJP7
Goa2BJP2
Gujarat26BJP26
Haryana10BJP+7INLD2
Himachal Pradesh4BJP4
Jammu and Kashmir6JKPDP3BJP3
Jharkhand14BJP12INC+2
Karnataka28BJP17INC9
Kerala20UDF12LDF8
Lakshadweep1NCP1
Madhya Pradesh29BJP27INC2
Maharashtra48BJP+42INC+6
Manipur2INC2
Meghalaya2BJP+1INC1
Mizoram1INC1
Nagaland1BJP+1
Orissa21BJD20BJP1
Puducherry1BJP+1
Punjab13SAD+6AAP4
Rajasthan25BJP25
Sikkim1SDF1
Tamil Nadu39AIADMK37BJP+2
Tripura2CPM2

Uttar Pradesh80BJP+73SP5
Uttarakhand (Uttaranchal)5BJP5
West Bengal42TMC34INC4

Tuesday 10 June 2014

India General (Lok Sabha) Election Results 2014




India General (Lok Sabha) Election Results 2014

 Disclaimer: All efforts have been made to make this image accurate. However Blogger and Raj do not own any responsibility for the correctness or authencity of the same.

Lok Sabha Election Result

WinLeadNDAUPAThird FrontOthers0100200300400AllianceSeats
AlliancePartyAbbreviationWon Seats
BJP+Bharatiya Janata PartyBJP282
OthersCommunist Party of IndiaCPI1
OthersCommunist Party of India (Marxist)CPM9
INC+Indian National CongressINC44
INC+Nationalist Congress PartyNCP6
OthersAam Aadmi PartyAAP4
OthersAll India Anna Dravida Munnetra KazhagamAIADMK37
BJP+All India N.R. CongressAINRC1
OthersAll India Trinamool CongressAITC34
OthersAll India United Democratic FrontAIUDF3
OthersBiju Janata DalBJD20
OthersIndian National Lok DalINLD2
INC+Indian Union Muslim LeagueIUML2
OthersJammu & Kashmir Peoples Democratic PartyPDP3
OthersJanata Dal (Secular)JD(S)2
OthersJanata Dal (United)JD(U)2
INC+Jharkhand Mukti MorchaJMM2
INC+Kerala Congress (M)KEC(M)1
BJP+Lok Jan Shakti PartyLJP6
BJP+Naga Peoples FrontNPF1
BJP+National Peoples PartyNPP1
BJP+Pattali Makkal KatchiPMK1
INC+Rashtriya Janata DalRJD4
OthersRevolutionary Socialist PartyRSP1
OthersSamajwadi PartySP5
BJP+Shiromani Akali DalSAD4
BJP+ShivsenaSHS18
OthersSikkim Democratic FrontSDF1
OthersTelangana Rashtra SamithiTRS11
BJP+Telugu DesamTDP16
OthersAll India Majlis-E-Ittehadul MuslimeenAIMIM1
BJP+Apna DalAD2
BJP+Rashtriya Lok Samta PartyRLSP3
BJP+Swabhimani PakshaSWP1
OthersYuvajana Sramika Rythu Congress PartyYSRC9
OthersIndependentIND3
Total543

Interview Questions

jdbc Interview Questions and Answers
Jsp Interview Questions and Answers
EJB 3.0 Interview Questions and Answers
corejava Interview Questions and Answers
Servlet Interview Questions and Answers
JMS Interview Questions and Answers
J2ME Interview Questions and Answers
CVS interview questions and answers
JMX interview questions and answers
AWT interview questions and answers
Core Java interview questions and answers
Eclipse interview questions and answers
Hibernate interview questions and answers
IBM WebSphere interview questions and answers
J2ME interview questions and answers
J2SE interview questions and answers
Java Applet interview questions and answers
Java Beans interview questions and answers
Java EJB Programming interview questions and answers
Java Enterprise Edition(J2EE) interview questions and answers
Java JSP Programming interview questions and answers
Java Message Service(JMS) interview questions and answers
Java Networking - Sockets And RMI interview questions and answers
Java Patterns interview questions and answers
Java Security interview questions and answers
Java Servlet Programming interview questions and answers
Java Swing Programming interview questions and answers
Java Threads interview questions and answers
Java interview questions and answers
JBoss interview questions and answers
JDBC interview questions and answers
JMS interview questions and answers
JSF interview questions and answers
RMI interview questions and answers
Spring Framework interview questions and answers
Struts interview questions and answers

Java Enterprise Edition(J2EE) Interview Questions and Answers

 
 

Java Enterprise Edition(J2EE) Interview Questions and Answers

 
 
 
 
 
Download Link

Jsp Interview Questions and Answers

 

JSP Interview Questions and Answers

 
 
 
Download Link
 
 

Servlet Interview Questions and Answers

 

            Servlet Interview Questions and Answers

 
                     

Java Threads interview questions and answers

      

        Java Threads Interview Questions and Answers

                             
                                 Download Link 
 
                   

Core Java Interview Questions and Answers

                                    

   Core Java Interview Questions and Answers





   

   Core java Interview Questions and Answers