0% found this document useful (0 votes)
4 views

UNIT I Java

Java is a high-level, object-oriented programming language developed by James Gosling at Sun Microsystems in 1991, later acquired by Oracle Corporation. It has three main editions: Java Standard Edition (JSE) for desktop applications, Java Enterprise Edition (JEE) for server applications, and Java Micro Edition (JME) for mobile applications. Key features of Java include its simplicity, robustness, security, and platform independence, allowing code to run on any device with a Java Virtual Machine.

Uploaded by

you.balajib5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

UNIT I Java

Java is a high-level, object-oriented programming language developed by James Gosling at Sun Microsystems in 1991, later acquired by Oracle Corporation. It has three main editions: Java Standard Edition (JSE) for desktop applications, Java Enterprise Edition (JEE) for server applications, and Java Micro Edition (JME) for mobile applications. Key features of Java include its simplicity, robustness, security, and platform independence, allowing code to run on any device with a Java Virtual Machine.

Uploaded by

you.balajib5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

UNIT-1

BASICS OF JAVA

Java
Java is a high-level, general-purpose, object-oriented, and secure programming
language developed by James Gosling at Sun Microsystems, Inc. in 1991. It is formally
known as OAK. In 1995, Sun Microsystem changed the name to Java. In 2009, Sun
Microsystem takeover by Oracle Corporation.
Java was developed by James Gosling at Sun Microsystems and it was released in
May 1995 as a core component of Sun Microsystems' Java platform.

EDITIONS OF JAVA
Each edition of Java has different capabilities. There are three editions of Java:
o Java Standard Editions (JSE): It is used to create programs for a desktop computer.
o Java Enterprise Edition (JEE): It is used to create large programs that run on the
server and manages heavy traffic and complex transactions.
o Java Micro Edition (JME): It is used to develop applications for small devices such
as set-top boxes, phone, and appliances.

TYPES OF JAVA APPLICATIONS


There are four types of Java applications that can be created using Java programming:
o Standalone Applications: Java standalone applications uses GUI components such
as AWT, Swing, and Java. These components contain buttons, list, menu, scroll
panel, etc. It is also known as desktop alienations.
o Enterprise Applications: An application which is distributed in nature is called
enterprise applications.
o Web Applications: An applications that run on the server is called web applications.
We use JSP, Servlet, spring, and Hibernate technologies for creating web
applications.
o Mobile Applications: Java ME is a cross-platform to develop mobile applications
which run across smartphones. Java is a platform for App Development in Android.

JAVA PLATFORM
Java Platform is a collection of programs. It helps to develop and run a program
written in the Java programming language. Java Platform includes an execution engine, a
compiler and set of libraries. Java is a platform-independent language.

FEATURES OF JAVA
o Simple: Java is a simple language because its syntax is simple, clean, and easy to
understand. Complex and ambiguous concepts of C++ are either eliminated or re-
implemented in Java. For example, pointer and operator overloading are not used in
Java.
o Object-Oriented: In Java, everything is in the form of the object. It means it has
some data and behavior. A program must have at least one class and object.

1|Page
o Robust: Java makes an effort to check error at run time and compile time. It uses a
strong memory management system called garbage collector. Exception handling
and garbage collection features make it strong.
o Secure: Java is a secure programming language because it has no explicit pointer
and programs runs in the virtual machine. Java contains a security manager that
defines the access of Java classes.
o Platform-Independent: Java provides a guarantee that code writes once and run
anywhere. This byte code is platform-independent and can be run on any machine.

o Portable: Java Byte code can be carried to any platform. No implementation-


dependent features. Everything related to storage is predefined, for example, the size
of primitive data types.
o High Performance: Java is an interpreted language. Java enables high performance
with the use of the Just-In-Time compiler.
o Distributed: Java also has networking facilities. It is designed for the distributed
environment of the internet because it supports TCP/IP protocol. It can run over the
internet. EJB and RMI are used to create a distributed system.
Java
Our core Java programming tutorial is designed for students and working
professionals. Java is an object-oriented, class-based, concurrent, secured and general-
purpose computer-programming language. It is a widely used robust technology.

What is Java?
Java is a programming language and a platform. Java is a high level, robust,
object- oriented and secure programming language.
Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in
the year 1995. James Gosling is known as the father of Java. Before Java, its name was
Oak. Since Oak was already a registered company, so James Gosling and his team changed
the name from Oak to Java.

Platform: Any hardware or software environment in which a program runs, is known as a


platform. Since Java has a runtime environment (JRE) and API, it is called a platform.

Java Example

2|Page
Let's have a quick look at Java programming example. A detailed description of
Hello Java example is available in next page.
Simple.java
1. class Simple{
2. public static void main(String args[]){
3. System.out.println("Hello Java");
4. }
5. }

Application
According to Sun, 3 billion devices run Java. There are many devices where Java is
currently used. Some of them are as follows:
1. Desktop Applications such as acrobat reader, media player, antivirus, etc.
2. Web Applications such as irctc.co.in, javatpoint.com, etc.
3. Enterprise Applications such as banking applications.
4. Mobile
5. Embedded System
6. Smart Card
7. Robotics
8. Games, etc.

Types of Java Applications


There are mainly 4 types of applications that can be created using Java programming:
 Standalone Application
Standalone applications are also known as desktop applications or window-
based applications. These are traditional software that we need to install on every
machine. Examples of standalone application are Media player, antivirus, etc. AWT
and Swing are used in Java for creating standalone applications.
 Web Application
An application that runs on the server side and creates a dynamic page is
called a web application. Currently, Servlet, JSP, Struts, Spring, Hibernate, JSF, etc.
technologies are used for creating web applications in Java.
 Enterprise Application
An application that is distributed in nature, such as banking applications, etc.
is called an enterprise application. It has advantages like high-level security, load
balancing, and clustering. In Java, EJB is used for creating enterprise applications.
 Mobile Application
An application which is created for mobile devices is called a mobile application.
Currently, Android and Java ME are used for creating mobile applications.

Java Platforms / Editions


There are 4 platforms or editions of Java:
 Java SE (Java Standard Edition)
It is a Java programming platform. It includes Java programming APIs such
as java.lang, java.io, java.net, java.util, java.sql, java.math etc. It includes core
topics like OOPs, String, Regex, Exception, Inner classes, Multithreading, I/O

3|Page
Stream, Networking, AWT, Swing, Reflection, Collection, etc.
 Java EE (Java Enterprise Edition)
It is an enterprise platform that is mainly used to develop web and
enterprise applications. It is built on top of the Java SE platform. It includes topics
like Servlet, JSP, Web Services, EJB, JPA, etc.
 Java ME (Java Micro Edition)
It is a micro platform that is dedicated to mobile applications.
 JavaFX
It is used to develop rich internet applications. It uses a lightweight user interface API.

Java Architecture
Java Architecture is a collection of components, i.e., JVM, JRE, and JDK. It
integrates the process of interpretation and compilation. It defines all the processes involved
in creating a Java program. Java Architecture explains each and every step of how a
program is compiled and executed.
Java Architecture can be explained by using the following
steps:
There is process of compilation and interpretation in Java.
o Java compiler converts the Java code into byte code.
o After that, the JVM converts the byte code into machine code.
o The machine code is then executed by the machine.
The following figure represents the Java Architecture in which each step is elaborate

graphically.

Now let's dive deep to get more knowledge about Java Architecture. As we know
that the Java architecture is a collection of components, so we will discuss each and every
component into detail.

Components of Java Architecture


The Java architecture includes the three main components:

• Java Virtual Machine (JVM)


• Java Runtime Environment (JRE)
• Java Development Kit (JDK)

4|Page

Java Virtual Machine
The main feature of Java is WORA. WORA stands for Write Once Run Anywhere.
The feature states that we can write our code once and use it anywhere or on any operating
system. Our Java program can run any of the platforms only because of the Java Virtual
Machine. It is a Java platform component that gives us an environment to execute java
programs. JVM's main task is to convert byte code into machine code.
JVM, first of all, loads the code into memory and verifies it. After that, it executes
the code and provides a runtime environment. Java Virtual Machine (JVM) has its own
architecture, which is given below:

JVM Architecture
JVM is an abstract machine that provides the environment in which Java byte code is
executed. The falling figure represents the architecture of the JVM.

Class Loader: Class Loader is a subsystem used to load class files. Class Loader first loads
the Java code whenever we run it.

Class Method Area: In the memory, there is an area where the class data is stored during
the code's execution. Class method area holds the information of static variables, static
methods, static blocks, and instance methods.

Heap: The heap area is a part of the JVM memory and is created when the JVM starts up.
Its size cannot be static because it increase or decrease during the application runs.

Stack: It is also referred to as thread stack. It is created for a single execution thread. The
thread uses this area to store the elements like the partial result, local variable, data used for
calling method and returns etc.

Native Stack: It contains the information of all the native methods used in our application.

Execution Engine: It is the central part of the JVM. Its main task is to execute the byte code

5|Page
and execute the Java classes. The execution engine has three main components used for
executing Java classes.
o Interpreter: It converts the byte code into native code and executes. It sequentially
executes the code. The interpreter interprets continuously and even the same method
multiple times. This reduces the performance of the system, and to solve this, the JIT
compiler is introduced.
o JIT Compiler: JIT compiler is introduced to remove the drawback of the interpreter.
It increases the speed of execution and improves performance.
o Garbage Collector: The garbage collector is used to manage the memory, and it is a
program written in Java. It works in two phases, i.e., Mark and Sweep. Mark is an
area where the garbage collector identifies the used and unused chunks of memory.
The Sweep removes the identified object from the Mark

Java Native Interface


Java Native Interface works as a mediator between Java method calls and native libraries.

Java Runtime Environment


It provides an environment in which Java programs are executed. JRE takes our Java
code, integrates it with the required libraries, and then starts the JVM to execute it. To learn
more about the Java Runtime Environment.

Java Development Kit


It is a software development environment used in the development of Java applications
and applets. Java Development Kit holds JRE, a compiler, an interpreter or loader, and several
development tools in it. To learn more about the Java Development Kit, These are three main
components of Java Architecture. The execution of a program is done with all these three
components.

EVENT AND LISTENER (JAVA EVENT HANDLING)


Changing the state of an object is known as an event. For example, click on button, dragging
mouse etc. The java.awt.event package provides many event classes and Listener interfaces for event
handling.

JAVA EVENT CLASSES AND LISTENER INTERFACES


Event Classes Listener Interfaces
ActionEvent ActionListener
MouseEvent MouseListener and MouseMotionListener
MouseWheelEvent MouseWheelListener
KeyEvent KeyListener
ItemEvent ItemListener
TextEvent TextListener

6|Page
AdjustmentEvent AdjustmentListener
WindowEvent WindowListener
ComponentEvent ComponentListener
ContainerEvent ContainerListener
FocusEvent FocusListener

STEPS TO PERFORM EVENT HANDLING


Following steps are required to perform event handling:
1. Register the component with the Listener
REGISTRATION METHODS
For registering the component with the Listener, many classes provide the
registration methods. For example:
o Button
public void addActionListener(ActionListener a){}
o Menu Item
public void addActionListener(ActionListener a){}
o Text Field
public void addActionListener(ActionListener a){}
public void addTextListener(TextListener a){}
o Text Area
public void addTextListener(TextListener a){}
o Check box
public void addItemListener(ItemListener a){}
o Choice
public void addItemListener(ItemListener a){}
o List
public void addActionListener(ActionListener a){}
public void addItemListener(ItemListener a){}

Java Event Handling Code


We can put the event handling code into one of the following places:
1. Within class
2. Other class
3. Anonymous class
Java event handling by implementing Action Listener
1. import java.awt.*;
2. import java.awt.event.*;
3. class AEvent extends Frame implements ActionListener{
4. TextField tf;
5. AEvent(){
6. //create components
7. tf=new TextField();
8. tf.setBounds(60,50,170,20);

7|Page
9. Button b=new Button("click me");
10. b.setBounds(100,120,80,30);
11. //register listener
12. b.addActionListener(this);//passing current instance
15. //add components and set size, layout and visibility
16. add(b);add(tf);
17. setSize(300,300);
18. setLayout(null);
19. setVisible(true);
20. }
21. public void actionPerformed(ActionEvent e){
22. tf.setText("Welcome");
23. }
24. public static void main(String args[]){
25. new AEvent();
26. }

public void set Bounds(int xaxis, int yaxis, int width, int height); have
been used in the above example that sets the position of the component it may be
button, text field.

Thread Concept in Java


Before introducing the thread concept, we were unable to run more than one task in
parallel. It was a drawback, and to remove that drawback, Thread Concept was introduced.
A Thread is a very light-weighted process, or we can say the smallest part of the
process that allows a program to operate more efficiently by running multiple tasks
simultaneously.
In order to perform complicated tasks in the background, we used the Thread
concept in Java. All the tasks are executed without affecting the main program. In a

8|Page
program or process, all the threads have their own separate path for execution, so each
thread of a process is independent.

Another benefit of using thread is that if a thread gets an exception or an error at the
time of its execution, it doesn't affect the execution of the other threads. All the threads share
a common memory and have their own stack, local variables and program counter. When
multiple threads are executed in parallel at the same time, this process is known
as Multithreading.
In a simple way, a Thread is a:
o Feature through which we can perform multiple activities within a single process.
o Lightweight process.
o Series of executed statements.
o Nested sequence of method calls.
Thread Model
Just like a process, a thread exists in several states. These states are as follows:

1) New (Ready to run)


A thread is in New when it gets CPU time.
2) Running
A thread is in a Running state when it is under execution.
3) Suspended
A thread is in the Suspended state when it is temporarily inactive or under
execution.
4) Blocked
A thread is in the Blocked state when it is waiting for resources.
5) Terminated
A thread comes in this state when at any given time, it halts its execution
immediately.

Creating Thread
A thread is created either by "creating or implementing" the Runnable Interface or
by extending the Thread class. These are the only two ways through which we can create a
thread.

9|Page
Let's dive into details of both these way of creating a thread:

Thread Class
A Thread class has several methods and constructors which allow us to perform various
operations on a thread. The Thread class extends the Object class. The Object class
implements the Runnable interface. The thread class has the following constructors that are
used to perform various operations.

o Thread()
o Thread(Runnable, String name)
o Thread(Runnable target)
o Thread(ThreadGroup group, Runnable target, String name)
o Thread(ThreadGroup group, Runnable target)
o Thread(ThreadGroup group, String name)
o Thread(ThreadGroup group, Runnable target, String name, long stackSize)

Runnable Interface (run() method)


The Runnable interface is required to be implemented by that class whose instances are
intended to be executed by a thread. The runnable interface gives us the run() method to
perform an action for the thread.
start() method
The method is used for starting a thread that we have newly created. It starts a new
thread with a new callstack. After executing the start() method, the thread changes the state
from New to Runnable. It executes the run() method when the thread gets the correct time
to execute it.

Let's take an example to understand how we can create a Java thread by extending the
Thread class:
ThreadExample1.java
1. // Implementing runnable interface by extending Thread class
2. public class ThreadExample1 extends Thread {
3. // run() method to perform action for thread.
4. public void run()
5. {
6. int a= 10;
7. int b=12;
8. int result = a+b;
9. System.out.println("Thread started running..");
10. System.out.println("Sum of two numbers is: "+ result);
11. }
12. public static void main( String args[] )
13. {
14. // Creating instance of the class extend Thread class

10 | P a g e
15. ThreadExample1 t1 = new ThreadExample1();
16. //calling start method to execute the run() method of the Thread class
17. t1.start();
18. }
19. }

Output:

Creating thread by implementing the runnable interface


In Java, we can also create a thread by implementing the runnable interface. The
runnable interface provides us both the run() method and the start() method.
Let's takes an example to understand how we can create, start and run the thread
using the runnable interface.
ThreadExample2.java
1. class NewThread implements Runnable {
2. String name;
3. Thread thread;
4. NewThread (String name){
5. this.name = name;
6. thread = new Thread(this, name);
7. System.out.println( "A New thread: " + thread+ "is created\n" );
8. thread.start();
9. }
10. public void run() {
11. try {
12. for(int j = 5; j > 0; j--) {
13. System.out.println(name + ": " + j);
14. Thread.sleep(1000);
15. }
16. }catch (InterruptedException e) {
17. System.out.println(name + " thread Interrupted");

11 | P a g e
18. }
19. System.out.println(name + " thread exiting.");
20. }}
22. class ThreadExample2 {
23. public static void main(String args[]) {
24. new NewThread("1st");
25. new NewThread("2nd");
26. new NewThread("3rd");
27. try {
28. Thread.sleep(8000);
29. } catch (InterruptedException excetion) {
30. System.out.println("Inturruption occurs in Main Thread");
31. }
32. System.out.println("We are exiting from Main Thread");
33. }}
Output:

Java Networking
Java Networking is a concept of connecting two or more computing devices
together so that we can share resources.
Java socket programming provides facility to share data between different
computing devices.
Advantage of Java Networking
1. Sharing resources
2. Centralize software management
The java.net package supports two protocols,

12 | P a g e
1. TCP: Transmission Control Protocol provides reliable communication between the
sender and receiver. TCP is used along with the Internet Protocol referred as TCP/IP.
2. UDP: User Datagram Protocol provides a connection-less protocol service by
allowing packet of data to be transferred along two or more nodes

Java Networking Terminology


The widely used Java networking terminologies are given below:
1. IP Address
2. Protocol
3. Port Number
4. MAC Address
5. Connection-oriented and connection-less protocol
6. Socket
1) IP Address
IP address is a unique number assigned to a node of a network e.g. 192.168.0.1, It is
composed of octets that range from 0 to 255. It is a logical address that can be changed.
2) Protocol
A protocol is a set of rules basically that is followed for communication. For example:
o TCP
o FTP
o Telnet
o SMTP
o POP etc.
3) Port Number
The port number is used to uniquely identify different applications. It acts as a
communication endpoint between applications. The port number is associated with the IP address
for communication between two applications.
4) MAC Address
MAC (Media Access Control) address is a unique identifier of NIC (Network Interface
Controller). A network node can have multiple NIC but each with unique MAC address. For
example, an Ethernet card may have a MAC address of 00:0d:83::b1:c0:8e.
5) Connection-oriented and connection-less protocol
In connection-oriented protocol, acknowledgement is sent by the receiver. So it is reliable but
slow. The example of connection-oriented protocol is TCP. But, in connection-less protocol,
acknowledgement is not sent by the receiver. So it is not reliable but fast. The example of
connection-less protocol is UDP.
6) Socket
A socket is an endpoint between two way communications.

Java.net package
The java.net package can be divided into two sections:
1. A Low-Level API: It deals with the abstractions of addresses i.e. networking
identifiers, Sockets i.e. bidirectional data communication mechanism and Interfaces
i.e. network interfaces.
2. A High Level API: It deals with the abstraction of URIs i.e. Universal Resource
Identifier, URLs i.e. Universal Resource Locator, and Connections i.e. connections
to the resource pointed by URLs.

13 | P a g e
The java.net package provides many classes to deal with networking
applications in Java. A list of these classes is given below:

Authenticator Cache Request

Cache Response Content Handler

Cookie Handler Cookie Manager

Data gram Packet Data gram Socket

Data gram Socket Impl Interface Address

Jar URL Connection Multicast Socket

Inet Socket Address Inet Address

Inet4Address Inet6Address

List of interfaces available in java.net package:

Content Handler Factory Cookie Policy

Cookie Store Datagram Socket Impl Factory

File Name Map Socket Option<T>

Socket Options Socket Impl Factory

URL Stream Handler Protocol Family


Factory

NETWORKING FEATURES
In Java, there are several networking features that allow developers to create networked
applications. Some of the most commonly used networking features in Java are:

Java.net package:
This package provides classes to implement network protocols, such as TCP/IP, UDP,
Sockets, and URLs. It allows developers to establish connections and communicate with other
computers over a network.

14 | P a g e
Socket programming:
Java's java.net.Socket class provides a low-level interface for networking. It allows
developers to create client-server applications using TCP/IP or UDP protocols. Sockets can be used
to send and receive data over a network.

URL handling:
Java's java.net.URL class provides methods to handle URLs. It allows developers to read and
write data from a specified URL, such as reading a webpage or downloading a file from the internet.

InetAddress class:
The java.net.InetAddress class is used to represent Internet Protocol (IP) addresses.
It provides methods to get the IP address of a host, resolve hostnames, and perform IP address
manipulation.

Network interfaces:
Java's java.net.NetworkInterface class provides methods to retrieve information about
network interfaces on the system. It allows developers to determine available network interfaces,
their IP addresses, and other related information.
Server socket class:
Java's java.net.ServerSocket class allows developers to create server applications that listen
for incoming connections on a specific port. This class is used to implement server-side socket
programming.

Datagram Socket and Datagram Packet classes:


These classes are used for UDP-based networking in Java. The java.net.DatagramSocket class
represents a connectionless socket for sending and receiving datagram packets. The
java.net.DatagramPacket class encapsulates the data to be sent or received, along with the destination
or source address.

Multicast Socket class:


The java.net.MulticastSocket class is used to implement multicast networking in Java. It
allows sending and receiving IP multicast packets, enabling communication between multiple hosts
on a network. These are just a few of the networking features provided by Java. By utilizing these
features, developers can create robust and efficient networked applications in Java.

MULTIMEDIA

Multimedia is an engaging kind of media that offers a variety of effective ways to convey
information to users. Users can interact with digital information through it. It serves as a

15 | P a g e
communication tool. Education, training, reference materials, corporate presentations, marketing,
and documentary are a few industries that heavily utilize multimedia.

Multimedia, by definition, is the use of text, audio, video, graphics, and animation to convey
information in an engaging and dynamic way. In other terms, multimedia is a technological way of
presenting information that combines audio, video, images, and animations with textual data.
Examples include video conferencing, Yahoo Messenger, email, and the Multimedia Messaging
Service ( MMS Service (MMS).
As the name implies, multimedia is the combination of the words "multi" and "media,"
which refers to the various media (hardware/software) utilized for information
transmission.

COMPONENTS OF MULTIMEDIA
The following are typical multimedia elements:
1) Text - Text appears in all multi-media projects to some extent. To match the successful
presentation of the multimedia program, the text may be presented in a variety of font styles and sizes.
2) Graphics - The multimedia program is appealing because of its graphics. People
frequently find it difficult to read long passages of text on screens. As a result, visuals are
frequently utilized instead of writing to convey ideas, give context, etc. Graphics can be of
two different types:

o Bitmap - Bitmap images are authentic pictures that can be taken using tools like
digital cameras or scanners. Bitmap pictures are often not modifiable. Memory use
for bitmap pictures is high.
o Vector Graphics - Computers can draw vector graphics because they just need a
little amount of memory. These images can be changed.
3) Animation - A static picture can be animated to appear to be in motion. A continuous succession
of static images shown in order is all that makes up an animation. Effective attention-getting may be
achieved by the animation. Additionally, animation adds levity and appeal to a presentation. In
multimedia applications, the animation is fairly common.
Audio - Speech, music, and sound effects could all be necessary for a multimedia application.
4) They are referred to as the audio or sound component of multimedia. Speaking is a fantastic
educational tool. Analog and digital audio are both kinds. The initial sound signal is referred to as
analog audio or sound. Digital sound is saved on a computer. Digital audio is therefore utilized for
sound in multimedia applications.
5) Video - The term "video" describes a moving image that is supported by sound, such as a
television image. A multimedia application's video component conveys a lot of information quickly.
For displaying real-world items in multimedia applications, digital video is helpful. If uploaded to the
internet, the video really does have the highest performance requirements for computer memory and
bandwidth. The quality of digital video files may still be preserved while being saved on a computer,
similarly to other data. A computer network allows for the transport of digital video files. The digital
video snippets are simple to modify.

16 | P a g e
APPLICATIONS OF MULTIMEDIA
The typical areas where multimedia is applied are listed below.
1) For Entertainment purposes - Multimedia marketing may significantly improve the promotion
of new items. Both advertising and marketing staff had their doors opened by the economical
communication boost provided by multimedia. Flying banner presentations, video transitions,
animations, and audio effects are just a few of the components utilized to create a multimedia-based
advertisement that appeals to the customer in a brand-new way and encourages the purchase of the
goods.

2) For Education purposes - There are currently a lot of educational computer games accessible.
Take a look at an illustration of an educational app that plays children's rhymes. In addition to merely
repeating rhymes, the youngster may create drawings, scale items up or down, and more. There are
many more multimedia products on the market that provide children with a wealth of in-depth
knowledge and playing options.
3) For business purposes - There are several commercial uses for multimedia. Multimedia and
communication technologies have made it possible for information from international work groups.
Today's team members can work remotely and for a variety of businesses. A global workplace will
result from this. The following facilities should be supported by the multimedia network:
o Office needs
o Records management
o Employee training
o Electronic mail
o Voice mail
For marketing purposes - Multimedia marketing may significantly improve the promotion of new
items. Both advertising and promotion staff had their doors opened by the economical communication
boost provided by multimedia. Flying banner presentations, video transitions, animations, and audio.
4) effects are just a few of the components utilized to create a multimedia- based advertisement that
appeals to the customer in a brand-new way and encourages the purchase of the goods.

5) For banking purposes - Another public setting where multimedia is being used more and more
recently is banks. People visit banks to open savings and current accounts, make deposits and
withdrawals, learn about the bank's various financial plans, apply for loans, and other things. Each
bank wants to notify its consumers with a wealth of information. It can employ multimedia in a
variety of ways to do this. The bank also has a PC monitor in the clients' rest area that shows details
about its numerous programs. Online and internet banking have grown in popularity recently. These
heavily rely on multimedia. As a result, banks are using multimedia to better serve their clients and
inform them of their appealing financing options.
There are several media techniques that can be used in Java programming:

Image Manipulation:

17 | P a g e
Java provides various libraries and classes for loading, manipulating, and saving images. For
example, the javax.imageio package allows developers to read and write images in different formats,
while java.awt.image package offers classes for performing operations like scaling, cropping, and
filtering on images.

Audio Playback:
Java Sound API enables developers to play audio files of different formats. It provides classes
like Clip and AudioInputStream to load and manipulate audio data. JavaFX also provides media
classes for playing audio files, along with advanced features such as playback controls and volume
management.

Video Playback:
JavaFX has built-in media capabilities, which allow developers to play video files in different
formats. The javafx.scene.media package provides classes like MediaPlayer and MediaView for
handling video playback. By using these classes, you can control video playback, handle events, and
even apply visual effects to the video.

Animation:
Java provides several libraries and frameworks that support animation. For example, JavaFX
provides a powerful animation framework with classes like Animation, Timeline, and KeyFrame.
These classes allow you to create smooth animations by specifying time-based actions and transitions.

3D Graphics:
Java 3D API provides support for creating and manipulating 3D graphics in Java. It offers a
comprehensive set of classes and utilities for constructing and rendering 3D scenes. With Java 3D,
you can create complex 3D objects, apply textures and lighting effects, and even perform animations
in three-dimensional space.

Web Content Integration:


JavaFX provides WebView class that enables developers to embed web content in Java
applications. This allows you to integrate media elements like images, audio, and video from web
sources into your Java application.
These are just a few examples of media techniques that can be used in Java programming. Java provides a
rich ecosystem of libraries and frameworks, making it a versatile language for handling various types.

18 | P a g e

You might also like