Wednesday, November 19, 2014

JAVA Selenium - JAVA Introduction

For Java Selenium Web Driver, Java is preferred language and we will see Java features here.
Java Selenium can be used with Python, C#, Java, JavaScript and PHP.

JAVA:
Object Oriented: In Java, everything is an Object. Java can be easily extended since it is based on the Object model.
Platform independent: Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code.  
Simple:Java is designed to be easy to learn. If you understand the basic concept of OOP Java would be easy to master.
Secure: With Java's secure feature it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-key encryption.
Architectural-neutral :Java compiler generates an architecture-neutral object file format which makes the compiled code to be executable on many processors, with the presence of Java runtime system.
Portable:Being architectural-neutral and having no implementation dependent aspects of the specification makes Java portable. Compiler in Java is written in ANSI C with a clean portability boundary which is a POSIX subset.
Robust:Java makes an effort to eliminate error prone situations by emphasizing mainly on compile time error checking and runtime checking.
Multithreaded: With Java's multithreaded feature it is possible to write programs that can do many tasks simultaneously.  
Interpreted:Java byte code is translated on the fly to native machine instructions and is not stored anywhere.  
High Performance: With the use of Just-In-Time compilers, Java enables high performance.
Distributed:Java is designed for the distributed environment of the internet.

Dynamic: Java is considered to be more dynamic than C or C++

Java Object-Oriented - Java supports following Object-Oriented principles.
•Inheritance
•Overriding
•Polymorphism
•Abstraction
•Encapsulation
•Interfaces
•Packages

Inheritance - Using extends and implements
Overriding - ability to define a behavior that's specific to the subclass type which means a subclass can implement a parent class method based on its requirement.
Polymorphism  - Polymorphism is the ability of an object to take on many form.
Abstraction - An abstract class is one that cannot be instantiated.
Encapsulation - Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods.
Interface - An interface is a collection of abstract methods.
Package - A Package can be defined as a grouping of related types(classes, interfaces, enumerations and annotations ) providing access protection and name space management.

What is difference between JDK, JRE and JVM?

JRE: Java Runtime Environment. It is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution.
JDK: It's the full featured Software Development Kit for Java, including JRE, and the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs.
JVM: Java Virtual Machine , actually executes the java bytecode. It is the execution block on the JAVA platform. It converts the bytecode to the machine code.

No comments:

Post a Comment