JAVA

JAVA

Java is a write-once, run-anywhere programming language developed by Sun Microsystems. It is similar to C and C++ but a lot easier. You can combine Java with a lot of technologies like Spring, node js, Android, Hadoop, J2EE, etc… to build robust, scalable, portable and distributed full-fledged applications.

History of Java

Java was originally developed by James Gosling with his colleagues at Sun Microsystems during the early 1990s. Initially, it was called a project ‘Oak’ which had implementation similar to C and C++. The name Java has later selected after enough brainstorming and is based on the name of an espresso bean. Java 1.0, the first version was released in 1995 with the tagline of ‘write once, run anywhere’. Later, Sun Microsystems was acquired by Oracle. From there, there has been no looking back. The latest version of Java is Java 12 released in March 2019.

Features of Java

Java offers plenty of attractive features -

  • Platform independent language
  • Rich standard library making it easy to code. You can create a whole stand-alone application using Java.
  • Java supports automatic memory allocation and deallocation (called garbage collection).
  • It offers great performance as Java supports multithreading and concurrency, thus making it a highly interactive and responsive language.
  • Secure and simple

What is the Java platform?

You must have heard a lot about Java as a programming language. But, do you know it is also a ‘platform’? Java platform is a software-only platform quite different from traditional platforms like Windows, Mac, Linux or Solaris. The former runs on top of the hardware of the latter platforms. Java programs go through Java Virtual Machine, that converts the byte code into native code, thus making the program run just any device! This means you don’t need individual machine-specific compilers for the Java code to run. This is why Java is called a platform too. Java programming language is different from the Java platform. Java programming language helps you build applications. What you write in Java programming language is developed and run with the help of an existing collection of programs and tools collectively called a Java platform. Java platform consists of the JDK, JVM, and JRE.

There are four Java platforms of the Java programming language –

  • Java SE (Java Platform, Standard Edition)
  • Java EE (Java Platform, Enterprise Edition)
  • Java FX
  • Java ME (Java Platform, Micro Edition)

While stand-alone applications can be built on the Java SE platform, most of the world wide web (internet) depends on Java EE. Java ME is for applications on small devices (like mobile phones).

Components of Java

There are three main components of Java - JVM, JDK, and JRE.

JDK or Java Development Kit is where the developers write their code and run it through the JRE or Java Runtime Environment.

How is the code translated? That’s through the Java Virtual Machine (JVM). With JVM, any code is written in Java (or any other language) can be translated to Java bytecode. Any machine can then implement this code based on the Operating System. JVM resides inside the JRE along with the java packages (libraries).

There is learning in each line of this code.

  • class – this keyword is used to create a java class. When you run the program, you would give the command javac Test.java to compile and java Test.java to execute. If you are using IDE, you have to just right click on the class and select Run.
  • public – The public is an access modifier that indicates the visibility. The main method cannot have access modifier as private (access modifier). Private methods can be called only within the class, whereas public methods are visible to all.
  • static – Variables and methods can use the static keyword. Why is the main method static? For static methods, we don’t have to create an object. Hence, we don’t have to create an object of Test to invoke the main method.
  • void – if a method doesn’t return any value, its type is set as void.
  • int, String – these are two of the many data types that Java uses. Because it also uses primitive types, Java is not considered a fully Object-Oriented language.
  • System.out.println – out is a static field of the class System. This field stores the instance of PrintStream class. println() is the method of this class, that prints the required output to the console.



要查看或添加评论,请登录

BALAJI R的更多文章

  • IOS APPS DEVELOPMENT

    IOS APPS DEVELOPMENT

    What is iOS App Development? iOS app development is the process of creating software for Apple's iOS mobile operating…

    1 条评论
  • FRONT END DEVELOPER

    FRONT END DEVELOPER

    In this article, I give a concise yet complete rundown of all the main technologies used for front-end development…

    3 条评论
  • Generative AI

    Generative AI

    Generative AI refers to deep-learning models that can generate high-quality text, images, and other content based on…

  • GOOGLE ANALYTICS

    GOOGLE ANALYTICS

    In the digital age, understanding and analyzing user behavior is essential for businesses seeking to thrive online…

  • GOOGLE TRANSLATION

    GOOGLE TRANSLATION

    The Evolution of Google Translation Google Translation, initially launched in 2006, has undergone significant…

    1 条评论
  • AI IN EDUCATION

    AI IN EDUCATION

    Artificial Intelligence (AI) has emerged as a transformative force across various industries, and its impact on…

    1 条评论
  • Mechanical Engineering

    Mechanical Engineering

    Mechanical engineering, a diverse and dynamic field, plays a crucial role in shaping the modern world. It encompasses…

    1 条评论
  • LINUX

    LINUX

    Introduction: Linux, the renowned open-source operating system, has transformed the world of computing since its…

  • LAPTOPS

    LAPTOPS

    Introduction: In today's digital age, laptops have become an integral part of our lives. From students and…

  • MOBILE PHONES

    MOBILE PHONES

    Mobile phones have become an indispensable part of our lives. They are no longer just a means of communication but have…

社区洞察

其他会员也浏览了