Tag: Java Platforms
There are four Java platforms or editions. These are:
1- Java SE (Java Standard Edition):
This includes Java programming APIs like java.lang, java.io, java.net, java.util, java.sql, java.math, etc. It includes core subjects such as OOPs, String, Regex, Error, Multithreading, I / O Flow, Networking, AWT, Swing, Reflection, Set, etc.
2- Java EE (Java Enterprise Edition):
It is used to develop web and enterprise applications. It is built on the top of the Java SE platform. It contains topics such as Servlet, JSP, Web services, EJB, JPA, etc.
3- Java ME (Java Micro Edition):
A micro platform which is mainly used to develop mobile applications.
4- Java FX:
To develop rich internet applications, Java FX is used. It uses a lightweight user API.
Prerequisite:
To learn Java, You must have the knowledge of basic c/c++ programming language.
Example:
The following Java example is used to check if a number is positive or negative using if-else.
public class PositiveNegative { public static void main(String[] args) { double number = 12.3; // true if number is less than 0 if (number < 0.0) System.out.println(number + " is a negative number."); // true if number is greater than 0 else if ( number > 0.0) System.out.println(number + " is a positive number."); // if both test expression is evaluated to false else System.out.println(number + " is 0."); } }
When you run this program, the output will be:
12.3 is a positive number.
If you change the value of number to a negative number (say -12.3), the output will be:
-12.3 is a negative number.
In the above example, it is clear how variable ‘number’ is hacked to be positive or negative, by comparing it to 0.