10 September, 2014

Git plugin installation on Eclipse

Git plugin installation on Eclipse.

This is very easy and you can do this easily. Normally , Eclipse IDE comes with in-build git plug-in. But, some how if its missed, we can add as the external plugin. Follow the below step-by-step process .

Step by step process to install git  plugin on eclipse:-

Step 1) Use the repository location. i.e. http://download.eclipse.org/egit/updates

Step 2.) Go to Help > Install New Software

Step 3.) Add repository location, Click Add. Enter repository name as "EGit".Then click Ok to add repository location.

Step 4.) Expand “Eclipse Git Team Provider” and select “Eclipse Git Team Provider”. Then Click Next

Step 5.) Review product and click Next.

Step 6.) Accept the agreement and click Finish.

Step 7.) Then, it will take few time for download the plugin and binaries.

Step 8.) Then ,accept the prompt to restart the Eclipse.

Now Your Eclipse is ready to use Git Repository Plugin.

You can also verify the Git installation.

Step 1.) Go to Help > Install New Software

Step 2.) Click on Already Installed and verify plugin is installed.

Else you can verify by searching on Windows => preference => type egit on search box.



Screenshot 1:-






Screenshot 2:-








Hope it will help you.





Follow for more details on Google+ and @Facebook!!!

Find More :-


Error occured during initialization of VM (java/lang/NoClassDefFoundError: java/lang/Object)

This issue I faced with window 8. When I was trying to execute java command from command prompt it was showing this error.After long time analysis I found the reason for this issue. This issue is really ambiguous.Its normally a path issue, if your class path has configured proper and still its not working then it might be a big reason to worry.

Solutions 1 :- Check your class path , if not set then use the below command to set.

path = your_java_installation_bin_path; 

Solutions 2 :- Probably there is few more java.exe file in your windows directory (i.e. C:\) .Normally when windows automatic updates works on your machine it may be install java into some other reference directory and it may be the cause.So, when you are trying to execute the java command from command prompt its not able to locate the exact path . As a solution , I have done this
by removing all the java.exe files from windows directory.

You can search the java.exe file from windows directory and remove all java application files , except your own java installation directory. After removing all those extra java application files its working fine for me. Below the screen shot for finding and removing the java application file.






Hope it will help you.


See Also

java.library.path setting in netbeans for .dll/.so files

This issue has wasted my 2 days of time. Setting java library class path on NetBean IDE is bit tricky.
Finally I found and its working now. Some little bit setting you have to do with your NetBean IDE.This setup is only for NetBean IDE.

Follow the Steps :-

==>Right click on the Project
==>Properties
==>Click on RUN
==>VM Options : -Djava.library.path="C:\Your Directory where Dll is present"
==>Ok

Its working 100%. I have done this in my own project settings.



Hope it will help you.

See Also

09 August, 2014

Experienced Java Interview questions asked by CGI

3+ Year experienced java questions asked by CGI.

       1)  Tell me about your self ?

    Ans : Just describe yourself with cool & confidence.
    
2) What you know about our company?

   Ans : Remember , it’s a very crucial question. You must do one R&D before going to interview. You should know about their product, technical stuffs they are working, market value of the company ane other important stuffs.

3) What is transient variable ?

   Ans : Transient variables are not serializable. It helps to avoid a variable to being serialization.

4) Write the code to initialize the inner class members.

Ans : Code here

public class InnerClassTest {

      class innerTest{
            private int age;
           
            public void display(){
                  System.out.println("Age="+age);
            }
      }
      /**
       * @param args
       */
      public static void main(String[] args) {
            InnerClassTest.innerTest innerObj=new InnerClassTest().new innerTest();
            innerObj.age=20;
            innerObj.display();
      }
}
 5) How to retrieve the elements from the collection write the code ?

Ans : Java provides certain interfaces by using that we can retrieve the elements from collection.Example – Iterator, ListIterator and Enumeration.

Example :- ArrayList data retrival

public class ArrayListRetrive {

      /**
       * @param args
       */
      public static void main(String[] args) {
            ArrayList<String> arList=new ArrayList<String>();
            arList.add("Java");
            arList.add("is");
            arList.add("Powerful!!!");
           
            //Retrive elements from ArrayList using Iterator
            Iterator iTer=arList.iterator();
            while(iTer.hasNext()){
                  System.out.println(iTer.next());
            }
      }

}
6) What is static and instance variables and methods ?

Ans : Static variables are per class but the instance variables are per object. All object share a single copy of static variable. In case of static method , no need of object creation for calling static method. The static method can directly call by using class name. Instance method need object for calling.
7) What is dynamic loading and static loading of java class ?

Ans : Dynamic class loading is by Class.forName() , which loads the class dynamically. Also you can use reflection for dynamic class loading. But, the static class loading is working by using ‘new’ keyword.

8) What type of loading is class.forname() ?

Ans : Its dynamically locate and loads the class.

9) What is Hibenate 3 best benfits ?

Ans : There are many benefits of hibernate. But the most benefits are below :-

1.     It reduces the developer effort to writing queries.
2.     Its easy to use with relational object which maps with java class and database relation.
3.     Query tuning is not required and it implements separates cache which is reason for better performance.

10) I have 100 tables and fields. I want to find one table name and  column names.  Write a quey .

Ans :  I have used mySQL database for this below query.
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='EMPLOYEE';

 11) How to define a field name in hibernate using annotation ?


          Ans:- @Column  (Its provided by java persistent  API).

 12) What is Synchronization ?

          Ans:- Synchronization is a solution for concurrency issue. Java provide 'synchronized' keyword for implementing this.

  13) The most commonly used classes in collectionsn ?


08 August, 2014

Tavant Technologies Java Interview Questions - Experienced

Tavant Technologies
Round 1:F2F
1) Tell abt ur technical skills
2) How to work with ajax applications?
4) Asked about page factory design concepts.
5) What are the collections u used in ur project?
6) Framework explanation
7) How to find no of rows or columns in a table?
8) Diff b/w interface and abstract class?
9) Various oops concepts used in the project?
10) Roles and responsibilities.
11) SQL queriesa) how to find duplicate records in a table b) Display the name of the emp who is getting         10th maximum salary
12) Logical questions:
i) A 2l bottle and a 4l bottle, By this u have to give me 3l of water? Is it possible? If yes tell me how
ii) 8 balls, having same color and weight, out of that 1 is defective, a physical balance is given, using this how to find the defective one.

Round 2
1. What is run-time polymorphism? Explain with program? Where is it achieved?
2. SQL queriesemp table fieldsename,eid,age
a) Find the name of the emp who has 3rd max age
b) Having clause and where clause
3. Logical questions
a) Cake in round shape, u have to cut the cake by 3 times only, and u have to divide into 8 equal pieces
b) Using 5 zeros, how to make it as 120
c) He gave me a paper, asked me to tore the paper once, to make 3 equal pieces


Round 3- HR+ Managerial round

1. Tell abt ur self
2. Why u r looking for the job?
3. What are the difficulties u faced in ur previous job?
4. He is asking the same questions in different ways for 15 min
5. Framework
6. Difference b/w abstract class and interface.
7. Scenario-an abstract class implements an interface, can the abstract class implement the methods of interface?
8. From that he asked that do u perform auto it scripts in parallel execution?
9. Difference B/w primary key and unique key
10. Can unique key column hold null values? If yes how many null values?
11. Use of super keyword, order of execution
12. Collections u used in the project
13. When array will be used ? and when array list will be used?




02 July, 2014

Birla Soft Interview Question & Answers for Java 2- 4 year experience.

The below questions asked by Birla Soft for Java/J2EE. I tried to give the best answer , hope it will help you out to crack the interview.


Q. Tell me about your self?
 Ans:  Give your brief introduction.

Q. Is Java Pass by Reference or Pass by Value?
Ans : Its always pass by value .

Q. What is the difference between an Interface and an Abstract class?
Ans : Both are looks similar. But, the basic difference is abstract class can contain abstract and non abstract methods, where interface only contains abstract method (without method body). You can declare fields that are not static and final, and define public, protected, and private concrete methods in abstract class. But, in Interface all members are public, static and final , all methods are public.

Q. What is the purpose of garbage collection in Java, and when is it used?
Ans : Garbage collection is a special feature in java language. It helps developer to save time and extra mental tension for handling object allocation in memory. It automatically clean the unused object from memory which helps to allocate space at runtime. When there is no reference to an object found, it will clean that object from memory . You can run the garbage collection explicitly by using System.gc() .

Q. What is Marker interface? How is it used in Java?
Ans : Marker interface is an interface which help us to notify few information to JVM/Compiler. The marker interface does not have any body, it’s a empty interface. Ex. Cloneable, Serialization, etc.            

Q. Can you give few examples of final classes defined in Java API?
Ans: String, Integer ,Float ,etc. Basically all wrapper classed are final.

Q. What is the importance of init() method in Servlet?
Ans:  init() method is one of the life cycle method of servlet. This method runs once in total life. After servlet instance created and before it handles request the init() method will work. Its basically used for initializing values at the time of application startup.

Q. How to improve Servlet Performance ?
Ans: You need to do few tuning for this achievement. Few points below :-
1.     Use init() method for all expensive operation during initialization (may be static data or cached data ).
2.     Always avoid auto loading of servlet.
3.     Avoid SingleThreadModel.
4.     Use and control HttpSession properly.

Q. How can a servlet refresh automatically if some new data has entered the database?
Ans :  Basically it depends on the scenario , how you can handle. You need  handle this in dao layer, when doing insert operation you can call an utility method which will load the context ServletContextListener. Because, servlets are basically used for handling request and give the response.

Q. How does JSP handle run-time exceptions?
Ans: You can use isErrorPage=”true” in page attribute.

Q. What is an EJB Context?
Ans: The EJBContext interface provides an instance with access to the container-provided runtime context of an enterprise bean instance.