Facilitation Guide (Introduction To Java)
Facilitation Guide (Introduction To Java)
Introduction to Java
Index
Why Java?
https://www.softwaretestinghelp.com/real-world-applications-of-jav
a/
Most popular Java frameworks
Who invented Java?
However, the team soon realized that Oak was not well suited for this purpose and
shifted their focus to creating a general-purpose programming language that could run
on any platform. The language was renamed Java and was released to the public in
1995.
One of the key features of Java is its "write once, run anywhere" (WORA) capability,
which means that Java code can be compiled into platform-independent bytecode that
can run on any machine with a Java Virtual Machine (JVM). This has made Java a
popular choice for developing cross-platform applications.
Since its release, Java has become one of the most widely used programming
languages in the world, with applications ranging from desktop software to web
applications, mobile apps, and even enterprise systems.
IV. Understanding Java Architecture
Java is an Object oriented programming language and prior to it the most popular
object oriented programming language was C++. There were several procedural
programming languages like C, Cobol, Pascal and Basic, which were also popular at
that time.
So C++ was getting attention from the developer community as a right choice for
Object oriented language but it was not easily portable to all common operating
systems. At that time Java came as a platform independent programming language with
the tagline “Write once, run anywhere”.
Data and Functions: In procedural programming, the data and functions are separate,
whereas in object-oriented programming, the data and functions are encapsulated
within objects.
Complexity: OOP is better suited for complex systems, as it provides a more modular,
scalable approach to programming. Procedural programming can become difficult to
manage as the program grows larger.
Overall, while procedural programming focuses on functions and their relationships,
object-oriented programming focuses on objects and their relationships. OOP provides
a more modular and reusable approach to programming, making it better suited for
complex systems.
Java architecture refers to the overall structure and organization of the Java platform,
including its programming language, runtime environment, and class libraries. The Java
platform is designed to be portable and platform-independent, allowing Java
applications to run on any platform that supports the Java Virtual Machine (JVM).
Java Development Kit (JDK): The JDK is a software development kit that includes
everything needed to develop and run Java applications, including the Java compiler,
Java runtime environment, and a set of libraries and tools.
Java Virtual Machine (JVM): The JVM is an abstract machine that provides the runtime
environment for Java programs. It is responsible for interpreting the compiled Java
bytecode and executing it on the underlying hardware.
Java Class Libraries: The Java class libraries are a set of pre-written code modules
that provide a wide range of functionality to Java programs, including input/output
operations, networking, user interface development, and more.
Java Runtime Environment (JRE): The JRE is the subset of the JDK that is required
to run Java applications. It includes the JVM and the class libraries needed for running
Java programs. Please note that the JRE is enough to run any Java program if we are
not interested in compilation of Java code. JRE doesn’t contain any development tools
such as Java compiler, debugger.
Type a simple Java class, which will look like the following:-
public class Demo {
public static void main(String[] args) {
System.out.println("Hello, we are learning Java!!!!");
}
}
Also explain the different DOS commands to students like md, cd, dir, copy con etc to
make the students comfortable with running commands from the command prompt.
However, garbage collection does come with some overhead. The garbage collector needs
to perform its tasks periodically, which can introduce some pauses or overhead in the
execution of the program. Careful consideration of memory usage and performance tuning
may be necessary in certain situations to optimize the garbage collection process.
One of the major advantages of Java is that in Java, garbage collection is an automatic
memory management feature provided by the Java Virtual Machine (JVM). It ensures that
objects that are no longer referenced by the program are automatically identified and
reclaimed, freeing up memory resources. Unreachable objects are considered "garbage"
and are eligible for collection. Although there is a Java statement (System.gc()) that can call
a garbage collection function, it will just send a request to JVM for running garbage
collection. Actual decision on when to run the garbage collection is not within the control of
the programmer. However, programmers should write their code in such a way that more
items will be eligible for garbage collection.