Ads Sponsored By Google :)

Sunday, 18 August 2013

Hibernate 4.2.5|3.6|3.5|3.2|3.1 Jar Files Download

hibernate jar download, download hibernate jar, hibernate 3.0 jar download, hibernate 3.2 jar download, hibernate jar files download, hibernate 3 jar download, hibernate 3.5 jar download, hibernate download jar, hibernate 3.6 jar download, hibernate 4.2.4 jar file download, hibernate 4.2.4 Jar file fre download, hibernate 3.5 jar file free download, hibernate jar download.

Hibernate Jar files Download :

The core functionality of Hibernate   http://hibernate.org
Hibernate Jars Download

Hibernate 4.2.4 jar files Downloads in ZIP and TGZ formats :

Hibernate 4.2.4 Download 4.2.4.Final ZIP,

Hibernate 4.2.4 Download 4.2.4.Final TGZ

download hibernate jar

Hibernate 3.5.2 Core jar Download files in Binary and Source :

Hibernate Project metadata download: hibernate-core-3.5.2-Final.pom

Hibernate Binary download: hibernate-core-3.5.2-Final.jar

Hibernate Source download: hibernate-core-3.5.2-Final-sources.jar


Hibernate 3.1.3 jar Files download with differ in memory sizes :

   hibernate-3.1.3.zip.MD5     2006-03-2032 Bytes9

   hibernate-3.1.3.zip             2006-03-2023.0 MB61

   hibernate-3.1.3.tar.gz.MD5 2006-03-2032 Bytes1


   hibernate-3.1.3.tar.gz         2006-03-2018.5 MB19



Struts 2.3|1.3|1.2|1.1 jar files free download

struts jar download, struts 2.3 jar download, struts 1.2 jar download, struts 1.3 jar download, download struts jar files, struts 1.1 jar download, struts tiles jar download, struts 2.0 jar download, download struts 1.1 jar, struts 2 download jar, struts 1.1 jar download, struts 1.1 jar free download, struts 1.2 jar free download, struts 1.3 jar free download, struts 2.0 jar free download, struts 2.0 jar download, struts 2.3 jar files download

Struts 2.3 1.3 jar files Download

Struts 1.3 and Struts 2.3 Jar files are download here.

Struts 2.3 1.3 Jars


Struts 1.3 Jar's Documentation, Source, Examples :

    Struts 2.3 Jar's Documentation, Source, Examples : 

       

      Wednesday, 14 August 2013

      How many ways to Traverse HashMap in java With Example Code

      how to traverse a hashmap in java,java code to traverse a hashmap,traverse a hashmap java ,ways of traverse the map in java, traversing hashmap using foreach loop, traversing hashmap using KeySet Iterator, traversing hashmap using entrySet, Java Code for

      traversing Hashmap in java.


         In Java Collection Frame Work we have multiple ways of iterating the data from the Map, HashMap and TreeMap. As am java developer one of my colleagues attended the interview of experience of 4years on java. Then he got the question like this, write the java to iterate or retrieve the data from the hashmap or TreeMap or map in atleast four ways. So Candidate who going to attend for the java interview of experience of 2+, 3+, 4+,5+, 6+, 7+ etc..
      You can find the this type of questions in the interview. Why because these candidates did so many projects in real time, so if the interviewer think that these guys must have command on retrieving the data through Collection Object  by using the HashMap. Map, TreeMap Objects.

      In this tutorial we are going to retrieve the data from the Object of HashMap, Map, TreeMap. We are retrieving or traversing or iterating the data from HashMap, Map, TreeMap Object in five different ways.
      HashMap Traversing Techinques

      Consider an Example :

      In real time most of the cases we are using generics with Collection classes and interface, so its better to write the code in Collections with Generics to impress the interviewer.

      HashMap object creation along with Generics :

      HashMap<String, String> demo=new HashMap<String,String>();
      demo.put(”Michael”, “USA”);
      demo.put(“Jaffar”,”Afghan”);

      1) Iterating Map Object elements using the foreach loop :

      From JDK 5.0 Version so many updating are included in it, in which one of the updation is foreach loop for iterating over map by using KeySet of Map interface to get the keys. This will used to iterate the values of Map and display the key and value in pair.

      For Example:

      HashMap<String, String> demo=new HashMap<String,String>();
      demo.put(”Michael”, “USA”);
      demo.put(“Jaffar”,”Afghan”);
      for(String key : dmeo.keySet()){
      System.out.println(key+”  ”+demo.get(key));
      }

      Output :

      Iterating or Traversing the Map Using Java5 foreach loop
      Michael USA
      Jaffar Afghan

      2) Iterating HashMap, Map, TreeMap in java using KeySet Iterator:

        To Retrieve the HashMap, Map, TreeMap by using Iterator 

      For Example:
      Set<String> keyset=demo.keySet();
      Iterator<String> keysetIterator=keyset.iterator();
      While(keysetIterator.hasNext()){
      String  key=keysetIterator.hasNext();// stores Key “Michael”,”Jaffar”
      System.out.println(key+”  “+demo.get(key));// USA, Afghan
      }

      Output :
      Iterating or Traversing the Map Using Java5 Iterator
      Michael USA
      Jaffar Afghan

      3) Retrieving or Traversing the HashMap in java using EntrySet along with forLoop :

      From this Example we are retrieving the data using EntrySet along with foreachloop. EntrySet is collection of all Map Entries which contains Key and Value.

      For Example :

      Set<Map.Entry<String<String>> entryset-demo.entrySet();
      For(Entry entry : entrySet()){
      System.out.println(entry.getKey() +” “ +entry.getValue());
      }

      Output :

      Iterating or Traversing the Map Using entrySet
      Michael USA
      Jaffar Afghan

      4) Iterating HashMap in java using EntrySet and Iterator :

      Retrieving the data from the HashMap object using EntrySet and Itertor.

      For Example :

       Set<Map,Entry<String,String>> entrySet1=demo.entrySet();
       Itertor<Entyr<String, String>> entrySetIterator=entrySet1.iterator();
       While(entrySetIterator.hasNext()){
       Entry entry=entrySetIterator.next();
       System.out.println(entry.getKey()+”  ”+entry.getValue());
       }

      Output:

      Iterating or Traversing the Map Using Java5 Iterator & EntrySet
      Michael USA
      Jaffar Afghan

      Difference Between ArrayList Vs LinkedList in Java|ArrayList and LinkedList Differences

      ArrayList Vs LinkedList, LinkedList Vs ArrayList in java, Java ArrayList Linkedlist, Difference between ArrayList and LinkedList, difference between linkedlist and arraylist, Difference between Arraylist and Linkedlist with Example. arraylist and linkedlist difference in java,diff arraylist and linkedlist in java,compare arraylist and linkedlist in java,arraylist and linked list differences


      ArrayList Vs LinkedList

      In Java Collection Frame work Difference between LinkedList and ArrayList is one most Frequently Asked question in Java interview for Freshers,2+,3+,5+,6+ Experience also. Candidate’s who are going to attend for the Interview must be perfect in Core java and Collection Frame Work. In this Collection Frame Work we explained the Difference ArrayList  and  LinkedList is most frequently asked in the Interview, So Candidate must be Prefect in this Sections.


      ArrayList Vs LinkedList


      LinkedList Vs ArrayList

      LinkedList and ArrayList both of them are classes that implements List Interface, But Most of them don’t how the LinkedList and ArrayList work internally in different manner. From Difference between ArrayList and LinkedList in which ArrayList is implemented by resizable array and LinkedList is implemented by doubleLinkedList. From this tutorial you can find the how LinkedList and ArrayList are use in realtime that shows in the difference between LinkedList and ArrayList.

      1)    Array is data structure is used to store the data and delete the data is on the basis of the index. That makes faster in adding the element to the array. But Delete an element from the array makes to costly process, after deletion of the element from the array need’s to rearrange all elements. To Retrieve any element from the LinkedList does not iterate on the basis of the index and Random

      2)    Performance of the ArrayList is provides O(1) performance for retrieving the element, For LinkedList retrieve Order of O(n).

      3)    Insertion Operation are very easy and fast in LinkedList while comparing with ArrayList, there is a risk of resizing the array. ArrayList is need to update its index while adding any element to the ArrayList not at end of the Array. Removal of the element from the ArrayList is similar to Insertion in Arraylist, So LinkedList is better to use.

      4)    LinkedList requires much more memory compared to ArrayList, because ArrayList holds the only index data, but in LinkedList it necessary to hold address  of both Previous node  data and next node data.

      In Real Time Scenarios Where to Use LinkedList and ArrayList :

      LinkedList is not popular when compared to ArrayList, But Linked list is the best option to use in java when Compared with ArrayList.

      1)    In Web application or any application always requires to use Random access, if we want to access the nth element in the LinkedList. It’s easy to use.

      2)    If Application has more insertion and deletion operations, then it’s  better to use ArrayList, if no Resizing of Array.

      Core Java Written Questions VI

      java written test questions and answers, java written test questions, java questions and answers for written test,core java written test questions and answers, java written test questions with answers,core java written test, Core Java Written Test Questions Pdf Download, Core Java Written Test Questions Pdf Download

      Core Java Written Questions VI


                              1          2         3        4         5       6


      1) What is the Excepted Output of the Following Program?
          public class Demo {
          public int F1()    {
              static int i = 0;
              i++;
              return i;
          }
          public static void main(String args[])   {
              Demo demo = new Demo();
              demo.F1();
              int j = demo.F1();
              System.out.println(j);
          }
      }
       
      A. 2 B. 0 C. 1 D. Compile Time Error

      Answer: Option D

      Explanation:
      Compile Time Error will occur because, static is an illegal start of Expression.
      Compile time error is occur due to static an illegal start of the expression in which method variables have modifier.(but they always consider as local).

      2. What is the Expected Output Of the Following Program?
      class VText  {
          public static void main(String [] args)      {
              VText t = new VText();
              t.test();
          }
          void test()      {
              long [] x1 = {3,4,5};
              long [] x2 = bug(x1);
              System.out.print(x1[0] + x1[1] + x1[2] + " ");
              System.out.println(x2[0] + x2[1] + x2[2]);
          }

          long [] bug(long [] x3)      {
              x3[1] = 7;
              return x3;
          }
      }
       
      A. 15 15    B. 12 15      C. 3 7 5 3 4 5     D. 3 4 5 3 4 5


      Answer: Option A

      Explanation:
      Option A is Correct because the reference variables x1,x3 refers to the long array object. In this above class VText  having method bug() have an index array of [1] is updated the value as 7. then the reference variable x2 is also refers to same array object.
      From the Above Program Ouput is : 3+7+5+" "3+7+5
      Output will be 15 15
      3. What is the Excepted Output of the Folliwng Program?
      class Updates  {
          public static void main(String [] args)     {
              int i = 100;
              double j = 100.1;
              boolean j = (i = j); // Line No 7
              System.out.println(j);
          }
      }
       
      A. true B. false  C. Compile Time Error     D. Run Time Error or Exception.

      Answer: Option C

      Explanation:
      From the Above Program we can understand that at the line number 7, the line will works when (x==y).  While Taking Operators into considers (= =) and (=) in which == do operation and return boolean value. But = is used to assigns the value to variable.
      Of Course, output of the above program of the optiosn A,B and D are in correct.
      Learn more problems on : Operators and Assignments 
      Discuss about this problem : Discuss in Forum 

      4. What will be the output of the program? 
      class BitwiseOperators {
          public static void main(String [] args)     {
              int i = 11 & 9;
              int j = i ^ 3;
              System.out.println( j | 12 );
          }
      }
       
      A. 0    B. 14   C. 8   D. 7

      Answer: Option B

      Explanation:
      Option B is correct. From the Above Questions Operations between operands using operators. The & Operator generates one bit whent both bits are one. Then from Above Result of & Operation is 9. Even ^ Operator also genrates one bit, the result of the Operation is 10. The Operator |  produces the at least one bit is 1, then Result of the Operation is 14.

      5. What is the Excepted Output Of the Following Program ?
      class BoolTest {
          public static void main(String [] args)     {
              boolean a1 = true;
              boolean a2 = false;
              boolean a3 = true;
              if ( a1 & a2 | a2 & a3 | a2 )// Linn 8
                  System.out.print("Hello ");
              if ( a1 & a2 | a2 & a3 | a2 | a1 ) /*Line 10*/
                  System.out.println("JavaJavax");
          }
      }
       
      A. Hello  B. JavaJavax C. Hello JavaJavax           D. No output is produced

      Answer: Option B

      Explanation:
      Operator & has hiher precedence than | Operator, at the line number 8 a1 and a2 evalutes together produces as are a2 & a3. at the line number 10 a1 if the test is true then it shows JavaJavax.

      6. What is Expected Output Of the Following Program
      Class A{
         public static void main(String args[]){
          int i = l, j = 6; 
          while (j--) {
             i++; 
            } 
           System.out.println("x = " + x +" y = " + y);
          }
      }
       
      A. i = 6 j = 0    B. i = 7 j = 0     C. i = 6 j = -1    D. Compile Error

      Answer: Option D

      Explanation:
       Option D Compile Time Error is raises, because While loop always considers Boolean value.

      7. What is Expected Output Of the Following Program
      Class Demo{
      public static void main(String args[]){
      for (int x = 0; x < 4; x+= 2) { 
          System.out.print(x + " "); 
        } 
         System.out.println(x); // Lin No 5
         }
      }  
      A. 0 2 4   B. 0 2 4 5    C. 0 1 2 3 4   D. Compile Time Error.

      Answer: Option D

      Explanation:
      Compile time Error will raises because the variable x at line No 5 is accessed, because variable x is defined inside the for loop.

      8. What is the Excepted output of the Following Program
      int i = 3; 
      int j = 1; 
      if (i = j) // Line No 3{
          System.out.println("i =" + i); 
      }
       
      A. i = 1   B. i = 3    C. Compile Time Error
      D. No Output.


      Answer: Option C

      Explanation:
      In the Above program at the Line No 3 uses the = operator instead  ==, so if statement  receives the integer instead of boolean.

      9. What is the Expected Output Of the Following Program?
      public class A{  
          public static void main(String [] args)     {
              try         {
                  ErroeMethod();  
                  System.out.print("X");  
              } 
              catch (RuntimeException ex) // Line No 7        { 
                  System.out.print("Y"); 
              } 
              catch (Exception ex1)         { 
                  System.out.print("Z"); 
              } 
              finally {
                  System.out.print("W"); 
              } 
              System.out.print("U"); 
          } 
          public static void ErrorMethod()     { 
              throw new RuntimeException(); 
          } 
      }
       
      A. XY   B. XYZ   C. XYW    D. XYZWU

      Answer: Option C

      Explanation:
      In the Above Program Runtime Exception is thrown and is caught at the line number  7, then all the code after the finally block is run exception is catched.


      For More Java Interview Questions and Answers

                              1          2         3        4         5       6

      Core Java Written Test Questions V

      java written test questions and answers, java written test questions, java questions and answers for written test,core java written test questions and answers, java written test questions with answers,core java written test, Core Java Written Test Questions Pdf Download, Core Java Written Test Questions Pdf Download


      For More Java Interview Questions and Answers

                              1          2         3        4         5       6


      1. which of the following declaration that follows the class level variable, and variable declarations will not compile ?  

       A. protected int a;                                                           B. transient int b = 3;
      C. private synchronized int e;                                       D. volatile int d;

      Answer: Option C

      Explanation:
      From the above question Option C is correct, it  will not compile; Sychronized modifier applies only for methods and blocks.
      Option A,C,D are correct, because protected, transient variable and volatile are legal.

      2. What will be the output of the program?

      public class DemoTestt  {
          public static void main(String[ ] args)     {
              float x1[ ], x2[ ];
              x1 = new float[10];
              x2 = x1;
              System.out.println("x2[0] = " + x2[0]);
          }
      }  
       
      A. Above Code  prints f2[0] = 0.0                B. It prints f2[0] = NaN
      C. An error at f2 = f1; causes compile to fail. D. It prints the garbage value.

      Answer: Option A

      Explanation:
      From the Program Code Snippet, Option A is Correct because, When an array(x1=new float[10];) in which elements are initilises to default values for the primitive data types(float in case of 0.0). so x1 will contain 10 elements with default float values. x2=x1 copies all the elements in x1 to x2. Then while retrieving the x2 array of the zero index have value 0.0.

      3. Public class X {
                         X( ) { }
                      }
                     class Y extends X
                     { }

      Which of the following Statement is true?
       A.   Class Y'S constructor is public.                   B. Class Y'S constructor has no arguments.
       C.   Class Y'S constructor includes a call to this( ). D. None of these.

      Answer: Option B

      Explanation:
      From the Above Code Snippet. Option B is correct. Because Class Y inherits Class X's constructor which has no arguments. Option A is wrong. Class Y inherits Class X's constructor which uses default access. Option C is wrong. There is just no implicit call to this( ).

      4. // Some Statements are Missing
          public class ModelTreeSet extends java.util.TreeSet  {
          public static void main(String [] args)      {
              java.util.TreeSet ts = new java.util.TreeSet();
              ts.clear();
          }
          public void clear()      {
              TreeMap tm = new TreeMap();
              tm.clear();
          }
      }
      which two statements, added independently at beginning of the program, allow the code to compile?

      1) No statement is required    2) import java.util.*; 3) import.java.util.Tree*;
      4) import java.util.TreeSet;     5) import java.util.TreeMap;  
      A. 1 only      B.  2 and 5   C.  3 and 4        D.  3 and 5

      Answer: Option B

      Explanation: From the above Code Snippet Option B is Correct has (2) and (5). TreeMap related class is imported , but TreeSet Class related need not import, specailly because it is represented as fully qualified name. Option {1} is  not correct because TreeMap is must and should import. Option {3}  is not correct syntax because of import statement. Option{4} is incorrect because it is not import TreeMap.

      5. What is the Excpeted of the Following program?
      class Demo {
          byte a;
      }

      class test {
          public static void main(String [] args)      {
              test p = new test();
              p.init();
          }
          void start()      {
              Demo t = new Demo();
              System.out.print(t.a + " ");
              Two t2 = fix(t);
              System.out.println(t.a + " " + t2.x);
          }

          Demo update(Demo tt)     {
              tt.a = 88;
              return tt;
          }
      }  
      A.  null null 88 B.  0 0 88      C.  0 88 88 D.  0 0 0

      Answer: Option C

      Explanation:
      From the above snippet has  update() method, of return type Class Demo, in which reference variable tt refers to the same object (class Demo) as the t reference variable. While Updating the tt.x in the update() method similar to it updates t.x also updates the same object.

      6.  What is the Excepted Output of the Following Code Snippet?
      public class test  {
          static boolean f1,f2;
          public static void main(String [] args)      {
              int i = 0;
              if ( !f1 )   { // Line 7
                  if ( !f2 )  { // Line 8
                      f1 = true;
                      i++;
                      if ( 5 > 6 ) {
                          i++;
                      }
                      if ( !f1 )
                          i = i + 10;
                      else if ( f2 = true )// Line 15
                          i = i + 100;
                      else if ( f1 | f2 ) // Line 17
                          i = i + 1000;
                  }
              }
              System.out.println(i);
          }
      }  
      A. 0   B.  1  C. 101     D. 111  

      Answer: Option C

      Explanation:
      From the Abov code Snippet f1, f1 are initialized to false, in which if it tests on the line no. 7 and 8 are sucess full. then f1 is set to true and also i is incremented. then test is suceed on the line number 19, in which code is not testing to see that f2 is true. Since line15 is successful but line no17 is skipped.

      7. What is the Output of the Following program ?
      public class Case  {
          static boolean f;
          public static void main(String [] args)      {
              short count = 42;
              if ( count < 50 & !f ) // Line 5
                  count++;
              if ( count> 50 );     // Lin 7
              else if ( count> 40 )       {
                  count += 7;
                  count++;  
              }
              else
                  --count;
              System.out.println(count);
          }
      }  
       A.  41             B. 42   C.  50     D.  51

      Answer: Option D

      Explanation:

      From the above Code Snippet boolean instance variables are default initialized to false, if the condition on the line number 5  is true then count increments, Line  is legal syntax only, do nothing statement. So else if is true count with 7 is added.

      8. What is the excepted output of the following code snippet ?
      int x= O;
      while(1)  {
          if(x == 4)      {
              break;
          }
          ++x;
      }
      System.out.println("x = " + x);  
      A.   x = 0     B.  x= 3     C.  x = 4 D. Compile time error

      Answer: Option D

      Explanation:
      In the Above code snippet the while value iteration is on the basis of the int value, but is not legal. because the while condition always represents the boolean value.

      9. What is the Excepted output of the Following Code Snippet ?
      int x= 0, y = 5;
          tt: for (;;) {
              x++;
              for (;;)  {
                  if(x > --j)  {
                      break tt;
                  }
              }
              System.out.println("x =" + x + ", y = " + y);  

      A. x = 1, y = 0      B.  x = 1, y = 4      C.  x = 3, y = 4      D. Compilation fails.

      Answer: Option D

      Explanation:

      From the above code snippet it raises the compile time error, because curly braces are missing at the end of the code.

      10. What will be excepted output of the following Code?
      int i = 0;
      label:
          if (i < 2) {
          System.out.print("i is " + i);
          i++;
          continue label;
      }  
       
      A.  i is 0         B.  i is 0 i is 1   C. Compilation fails. D. None of the above

      Answer: Option C

      Explanation:
      From the above code snippet, Code is not compile because the continue statement, is occur only in the looping only(while & do while). if the syntax were legal. Combination of the if statement and continue is legal then it would create the kludgey kind of loop. Compiler always recommend to write much cleaner code than this.




      For More Java Interview Questions and Answers

                              1          2         3        4         5       6

      LinkWithin