Sunday, 31 July 2016

Java Basics - Understanding core concepts


C - can write programs - No OOPS concepts
C++ - got knowledge - partial OOPS concepts


java -
.Net - Framework - C#(== core) java - programing language
C# and java are developed based on OOPS concepts
PHP - developed based on OOPS concepts - FACEBOOK
Phython - developed based on OOPS concepts

OOPs (Concept) - Object Oriented Programing language - java,.net,python,php
Structure oriented programing - c,c++ (partial oops)
OOPS - IPE (Inheritance,Polymorhism and Encapsulation))
Access specifiers - private , public , protected and default

J2SEE - Standard Edition 1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8 - core java - Sun - Oracle(present)

J2EE - Enterprise Edition - J2EE API(Servlets, Jsp) complance - advance java - Sun - Oracle(present)

Servers developed on J2EE API - Apache - Tomcat WS, Jboss AS, IBM- Websphere AS , Weblogic AS
JDBC API - data base - ORACLE, MYSQL, SYBASE, DB2..etc

Sun released API'S like J2SE,J2EE and J2ME - Since Oracle acquired Sun, now all these API's maintaining by Oracle.

JDK (Java Development Kit) - SDK (Software Development Kit) - JDK is to compile your java files to generate .class files out of your .java files usint javac command.
Ex : javac HelloWorld.java   -> HelloWorld.class

javac command nothing but javac.exe resides in JDK, we also call it as java compiler.

javac is responsible to generate byte code (.class files)

JRE - Java Runtime Environment - JRE is nothing but collections libraries (jars) required to run java byte code. In other words to run .class files

java HelloWorld(.class)

While running java code (byte code) you use java command. It's nothing but java.exe available as part of JRE bundle.


For every version of java you'll provided by jdk and jre.
jdk - compile time
jre - run time

J2ME - Mobile Edition - Only for basic mobiles , not for smart phone - Sun - Oracle(present)
Android API on top of J2SE -  .apk - Only for smart phones - released from Google

core java , jdbc, servlets, jsp

Spring , Hibernate and Struts - java frameworks from third party companies developed on top of J2EE API and J2EE API to make the developers life easy.

Path and CLASSPATH are environment variables.
Path - All the executable you want to run from anywhere , then you must keep then in path environment variable.

All windows programs are .exe executables.
You can run executables only from the directory where they are located in the physical directory.
Else, if you want to run them from any directory then keep the directory of them in path variable.

Eg: typical path variable value - echo %PATH%

C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\windows\des_tools;C:\Program Files (x86)\WebEx\Productivity Tools;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\AppSense\Application Manager\Agent\Plugins\EcaRulesEngine\;C:\Program Files\Java\jdk1.8.0_45\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jre7\bin;C:\Users\vnemalik\Documents\001096043\soft\apache-maven-3.2.5\bin

CLASSPATH : - Classpath is also an environment variable but only specific to Java. - Only for java developers.

you keep jar file paths in class path variable to refer these classes/jars from your application.

Class path is needed when your application is dependent on external application that you need refer. You should keep the dependent application as a jar file in the class path variable.

OOPS - very important - OOPS is nothing but a guide lines or specification or standard set for software application development.

Inheritance -
Polymorphism - poly mean many, morphism means forms - many forms
An application or an object plays different role in different times i.e it is exhibiting different behavior at different times is nothing but polymorphism.
Encapsulation -

OOPS gave a solution on problem faced in earlier traditional oriented languages.
OOPS is a solution for the problem faced by developers in C and C++ languages.

Understand all the oops concepts with java examples thoroughly.



Java Interview :-

Core java:
-----------
  1. OOPS concepts
  2. Class
  3. Object
  4. Understanding Object.java class, which is a super class of all the classes in java
  5. packages
  6. inheritance with java example
  7. polymorphism with java example
  8. encapsulation with java example
  9. Abstract classes
  10. Interfaces
  11. exception handling with java example - both checked and unchecked exceptions.
  12. Understanding the difference between Error and Exception
  13. Threads - basics - Thread class and Runnable interface - how many ways we can create threads, what is the default thread in java .. etc
  14. JDBC - How would you connect to any database using java api - understanding DriverManager Class
  15. Java Collections - List , Set , Map , ArrayList , HashMap , HashSet .. etc - pros and cons of using a specific type of collection object.
  16. Java Generics - a new feature added from jdk 1.5
  17. New features introduced in each version of java from 1.5 to 1.8

Advance Java:
----------

Servlet programing
JSP - Java Server Pages
Understanding WebApplication and Enterprise Application
Must have knowledge on at least two application servers for instance Tomcat and JBoss
How to deploy application and work with it.

EJB - Not required for you

Books:

https://havealookonenglish.files.wordpress.com/2015/12/head-first-programming.pdf


Note:

Try a test/certification from these site. I heard companies hiring with the scores fresher's get from these site. Have a look on these once.

https://www.myamcat.com/
https://www.elitmus.com/












Monday, 25 July 2016

maven-eclipse-plugin


<!-- download source code in Eclipse, best practice -->

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-eclipse-plugin</artifactId>
 <version>2.9</version>
 <configuration>
  <downloadSources>true</downloadSources>
  <downloadJavadocs>false</downloadJavadocs>
 </configuration>
</plugin>

Tuesday, 19 July 2016

The static in-project repository solution

The static in-project repository solution:

<repository>
    <id>repo</id>
    <releases>
        <enabled>true</enabled>
        <checksumPolicy>ignore</checksumPolicy>
    </releases>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <url>file://${project.basedir}/repo</url>
</repository>



Use Maven to install to project repo:

mvn install:install-file -DlocalRepositoryPath=repo -DcreateChecksum=true -Dpackaging=jar -Dfile=[your-jar] -DgroupId=[...] -DartifactId=[...] -Dversion=[...]

<repository>
    <id>repo</id>
    <url>file://${project.basedir}/repo</url>
</repository>


<dependency>
    <groupId>org.swinglabs</groupId>
    <artifactId>swingx</artifactId>
    <version>0.9.2</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/swingx-0.9.3.jar</systemPath>
</dependency>



Registering your repository in pom.xml:

    <repository>
      <id>ProjectRepo</id>
      <name>ProjectRepo</name>
      <url>file://${project.basedir}/libs</url>

    </repository>