Wednesday, 3 July 2019

Java for Automation



JAVA
 
Java is released in 1995 by a company called Sun Microsystems (which has been acquired by Oracle).


Why Java is so much popular?

  • Open source
  • Object oriented programming language
  • Large community support
  • Platform Independent
  • In build Memory Management

Why Java is platform Independent?

 
Java compile the code in bytecode(.class), while other programming language compile the code in Native Code. 


For example: C# compile the code with .exe file extension and which is executable only in Windows Operating system. Java compile the code with .class extension, JVM read and execute this file in any operating system.


JDK
Java Development Kit: Develop and execute the Java program.


JRE
Java Runtime Environment: Only run the java program


JVM
Java Virtual Machine: Responsible for the line by line execution of the java program.


Note: Java is platform Independent but JVM is platform dependent.
 

How we can install Java on our computer?

You can download and install Java Software Development Kit(JDK) from the Oracle website.


Click on ‘Download’ button. 



Click onAccept the License Agreement’ and choose the jdk file corresponding to your OS.

After installing Java we need Eclipse for writing our code.

You can download and install Eclipse IDE for Java Developers from 


Download the eclipse file and launch.

Practice:

1.Create a JAVA project.

2.Create a JAVA package.

3.Create a JAVA class.

Naming format for project, package and class should be:

Project Name: Camel case [Each word begins with a capital letter]
Package Name: Start with small letter and should be one of the domain names like com, org.
Class/Interface: Camel case
Methods: First letter lower cases
Variables: First letter lower cases
Constant: All uppercase with words separated by underscores

4.Check the JRE system library/Src folder

5.Check the keywords and main method: Starting point of the JAVA program.

6.Comments in the JAVA code
  • Using //
  • Using   /*  */ 

No comments:

Post a Comment