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

Unit 1 (KCS602)

The document discusses the introduction to web technologies including what web technologies are, the history and development of the World Wide Web, protocols governing the web like HTTP and TCP/IP, different types of websites, cyber laws, web applications, writing web projects, and comparing traditional projects to web projects.

Uploaded by

mishrakhushi2510
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Unit 1 (KCS602)

The document discusses the introduction to web technologies including what web technologies are, the history and development of the World Wide Web, protocols governing the web like HTTP and TCP/IP, different types of websites, cyber laws, web applications, writing web projects, and comparing traditional projects to web projects.

Uploaded by

mishrakhushi2510
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

WEB TECHNOLOGY (KCS-602)

Unit- I
Introduction and Web Development Strategies

What Are Web Technologies?


Web technologies are the various tools and techniques that are utilised in the process of
communication between different types of devices over the internet.

To understand this term in a better manner, let’s break it down into two pieces: ‘web’ and
‘technology’.

The web, in this case, refers to the World Wide Web, more commonly known as WWW.
It first came into being in 1989 when famous scientist and engineer, Tim Berners-Lee,
came up with an efficient mechanism to share resources between scientists all over the
world.

Web Technology
You probably know that computers don't communicate with each other the way that people do.
Instead, computers require codes, or directions. These binary codes and commands allow
computers to process needed information. Every second, billions upon billions of ones and zeros
are processed in order to provide you with the information you need.
So what does that have to do with your ability to post your latest pictures online? Everything.
The methods by which computers communicate with each other through the use of markup
languages and multimedia packages is known as web technology. In the past few decades, web
technology has undergone a dramatic transition, from a few marked up web pages to the ability
to do very specific work on a network without interruption. Let's look at some examples of web
technology.

1. World Wide Web:


The World Wide Web is a system of interlinked hypertext documents accessed
via the Internet. Web is a huge collection of pages of information linked to each
other around the globe.

History of WWW:

WWW is created by Sir Tim Berners Lee in 1989 at CERN in Geneva.

In 1990, the first text only browsers were setup and CERN scientistcould
access hypertext files and other information at CERN. HTML was based
on a subset of the standard generalized markup language (SGML). To
transfer HTML document to remote sites a new protocol was devised
called HTTP (Hyper Text Transfer Protocol).
In the fall of 1991, conference goes around the world started hearing about
the promise but sparks still were not flying.
In 1993, there are only about 50 websites world wide. A browser that
allowed user to take advantage of the web’s graphical capabilities was
developed at the National center for Super Computing
application(NCSA). NCSA called the browser Mosaic.

In its infancy stage the Internet was originally conceived by the Department of Defense as a way to protect
government communication systems in the event of military strike. The original network dubbed ARPANet (for the
Advanced Research Projects Agency that developed it) evolved in to a communication channel among contractors,
military personnel and university researchers who were contributing to ARPA projects.

The network employed a set of standard protocols to create an effective way for these people to communicate and
share data with each other. ARPAnet’s popularity continued to spread among researchers and in 1980 the National
Science Foundation linked several high speed computers and took charge of what came known to be as the Internet.
By the late 1980’s thousands of cooperating networks were participating in the Internet. The NREN (National
Research Education Network) took up the initiative to develop and maintain high speed networks for research and
education and to investigate the commercial uses of the Internet.

2. Protocols Governing Web


Protocol: A protocol is a set of rules that is used to communicate applications to each other.
OR
A protocol is the interface required for communicating the different applications.
Classification:

a. HTTP
b. TCP/IP
c. FTP
d. E-MAIL
e. TELNET

A. HTTP: HTTP is the primary protocol used to distribute information on the web.
Initial HTTP 0.9 does not allow for content typing and does not have provisions for
supplying meta-information.
Content Typing: To identify the type of data being transferred.

Meta Information: It is supplemental data, such as environment variables that identify


the client’s computer
Current version is HTTP 1.0

B. TCP/IP: It is a set of rules that an application can use to package its information for
sending across the networks of networks.
C. FTP: It is used to transfer the files over networks.

D. E-Mail: It is a method of exchanging digital messages across the Internet or other


computer networks.
E. Telnet: Telnet lets you remotely log into another system and browse files and directories
on that remote system.

3. Website:A website is simply a collection of interlinked web pages.


Classification: A. Corporate Website B. Individual website

A. Corporate Website:
i. In this, there is certain no. of persons, who develop their website for a
particular organization.
ii. The corporate website are formed when group of people have common
interest and objective.
iii. The purpose of this website is to convey the information of organization to all
over the world.
B. Individual website: It is just like profile management system. In this type of
website an individual wants to develop website for h-projection, career growth etc.

4. Cyber Laws: Cyber law is a term used to describe the legal issues related to use of
communication technology, particularly “cyberspace” i.e. Internet.

Indian and International Cyber Law: Cyber Laws are formed by the government top
revent the internet crime. These crimes could be hacking, threat on internet, denial of
services etc. Cyberspace includes computer, computer networks, internet data,
software etc.
i. Data Protection and Privacy Law: This is due to the nature of the internet and
amount of information that may be accessed through it, such legislation is critical
to protect the fundamental rights of privacy of an individual.
ii. Electronic and Digital Signature Law: This is required so that uniform and
standard procedures are established for authentication of electronics records,
EDI, E-Mail.
iii. Computer Crime Law: due to victim of internet threats.

iv. Telecommunication Law: Approve and supervise the application of fees and
rates charged for telecommunication services in accordance with the provision of
the applicable law.
v. Intellectual Property Law: This includes copyright law, trademark law,
semiconductor law and patent law in relation to computer hardware and
software.

IT Act 2000 (INDIA):

E-Governance
Authentication of E-Records
Digital Signatures
Controlled certifying authorities
Penalties for damage of computer and computer system.

5. Web Applications:
Simple office software (word processors, online spreadsheets, and presentation
tools).
More advanced applications such as project management, computer-aided design,
video editing and point-of-sale.

6. Writing web Projects and Target Users:


A. Write a project mission statement: Write the specific mission statement that
you want to do.
B. Identify Objectives:
i. Specific
ii. Measurable
iii. Attainable
iv. Realistic
v. Time limited

C. Identify your target users: The matter of a website will be determined by the
users whom you want to visit the site. This is totally depend upon
i. Market research
ii. Focus group
iii. Understanding intranet audiences
D. Determine the scope: By supporting documents and client’s approval.
E. Budget:
i. Assumption for budgets.
ii. Budget categories.
iii. Determine hidden costs and tools.
F. Planning issues:
i. Discuss client’s existing information system.
ii. Project team and developing infrastructure.
iii. Where the websitewill place.
7. Comparison between traditional project and web project:

Web Projects Traditional Projects


1. Project managers are not always 1. They are always different.
client. They could be same.
2. Often beta technologies are used for 2. It is not applicable in this case
testing, often without tech support.
3. Pricing model for web projects does 3. It do exist for traditional
projects.
not exist.
4. Team roles are less specialized. 4. More specialized.
5. Clients are often unwilling to bear
the cost of web development. 5. Difficult of traditional projects.
6. Standards for web projects do not exist.
6. Standards for web projects exist.
7. Project manager’s responsibilities
are very broad. 7. Not true for these projects.

8. Identification of objects:
A. Object identification: All the components which are visible in website areobjects
or in other words, we can say that all visible components in the web browser are
defined as objects. Ex. Text box, command button etc.
B. Web development process:

Strategy Design and Produced desired


Specification result

Launch Register with ISP Testing and


Maintenance
Strategy:

Goals and
objectives Team
building Research
and review Project
proposal

Design and Specification:

Developing concept
Content planning
Rough design
Final design

Produced desired Result:

Build prototype
Prototype testing
Original design
Satisfy the clients
need
Testing and maintenance:

Test the code


Maintain the web server.

Register with ISP:

Register domain name


Get web space

Launch:

Connect domain name with web


server Finally host the web
accordingly.

9. Web Team:Web team is a group of various technical experts in a developing site


fromcoding the page to maintain the web server.

Types:
A. Server Side: hired by a company to develop a website.
B. Client Side: part of the company putting together the website.

Assessment techniques used to comprise a web team:

a. Deciding roles and responsibilities: The composition of team varies to dependon


the audience, scope and complexity level of the web. There are key roles on
each virtual project. One should always decide for core, extended and
specialteam members in a web and shares responsibilities accordingly.

b. Common Team Compositions: It is possible to acknowledge specific type

ofteams and determine to be based on the kind of project, who is likely to be part

of the team though these are all type of web project. As for example the team

composition might be account manager, creative lead, project manager, designer

etc.
c. Putting together with right team: It meet out the needs with low price,

moreeffectively in reasonable time. So it is the team that fulfils the website

requirements successfully.

d. Identifying Necessary Skills: The skill set in the base of web team. It must

havein care to plan, design, build and deploy a website.


Classification:

Core Team member Extended Team Member Special Team Member


1. Project Manager: 1. Account Manager: 1. Security
Specify the work. Developing It interacts with the Experts:
the project plan. Scheduling. client, project security
Allocation resources. manager and handling and
Budgeting and managing the team. creative lead. encryption
2. Technical lead: 2. Programmer: techniques.
Managing programmers. develops 2. Audio, Video
Chooses specialized team such as security applications for the Engineer
expert, database programmers. web projects. 3. 3-D Modeler
3. Web Production specialist: 3. Network Engineer: 4. Web Cast
Integrate the site using html or configuring a web Specialist
java script.
server. 5. Media Buyer
4. Creative Lead: determines creative concepts for 4. Information 6. Strategic
thesite and responsible for site design.
architects: It Planner
5. Quality Assurance Lead: for testing purpose.
understands how to
display information

visually to users and how to


interact with the website.

5. Content Writer: write


contents for the
website.
6. Tester: It tests
theweb
project based on
the team plan that
QA lead writes.
10. Planning and Process Development:
A. Early planning:
i. Know your audience.
ii. Interviewing.
iii. Focus group & Market
Research.
iv. Gathering end user requirement.

B. Content planning:
i. Get images.
ii. Create links.
iii. Audio & Video
iv. Shockwave & other media files.
C. Technical planning:
i. Database.
ii. Shockwave movies.
iii. Transaction system.
iv. Scripts of all kinds.

D. Production planning:
i. Market research.
ii. Combine the web pages
iii. Get complete web.

11. Explain the following terms:


A. ARPANET
B. ISP
C. UDP
D. Uploading of files
E. Portal

A. ARPANET:
In 1969, a project was funded by the Advanced Research Project
Agency (ARPA), an arm of the U.S. Department of Defense. ARPA
established a packet-switching network of computers linked by
point-to-point leased lines called Advanced Research Project
agency Network (ARPANET) that provided a basis for early
research into networking.

The conventions developed by ARPA is specify how individual


computers could communicate across that network became TCP/IP.

As networking possibilities grew to include other types of links and


devices, ARPA adapted TCP/IP to the demands of the new
technology. As involvement in TCP/IP grew, the scope of
ARPANET expanded until it became the backbone of an internet-
work today referred to as the internet.

B. ISP:

The Internet Service Provider (ISP) gives you the telephone access and
software you need to connect to the internet along with some technical
help.

Many ISPs also include an electronic mail account, host customers web
pages and offer services a company that do business on the Internet.
There are aprox. 200 ISPs in India like VSNL, MTNL,
ERNET(Education and Research Community Network) etc.

C. UDP:
The User Datagram Protocol (UDP) is one of the core members of the Internet
Protocol Suite, the set of network protocols used for the Internet. With UDP,
computer applications can send messages, in this case referred to as datagrams, to
other hosts on an Internet Protocol (IP) network without requiring prior
communications to set up special transmission channels or data paths.
Packet structure:

bits 0 – 15 16 – 31

0 Source Port Number Destination Port Number

32 Length Checksum

64 Data

D. Uploading of files:

Uploading requires a 6 MHz. bandwidth in a range below 40 MHz.


At this low frequency, home appliances can create a noisy environment
that effect modulation.

The modulation technique that is normally used is QPSK (4bit at a time).


This means that a user can upload information at a rate of 12 Mbps.
Presently the uploading rate is between 500 Kbps and 1 Mbps.

E. Portal:
A web portal, also known as a links page, presents information from diverse
sources in a unified way. Apart from the standard search engine feature, web
portals offer other services such as e-mail, news, stock prices, information,
databases and entertainment. Portals provide a way for enterprises to provide a
consistent look and feel with access control and procedures for multiple
applications and databases, which otherwise would have been different entities
altogether. Examples of public web portals are AOL, iGoogle, MSNBC, Netvibes,
and Yahoo.
Internet Services:
Internet is a very good medium to connect with the outer world. People use it as a medium to connect with other
people sharing files, entertainment and lots of other activities that are useful and beneficial in many ways. The few
dominant reasons why people use the Internet are given below:

Information: People browse Internet for information. They love to browse various search engines like Google,
Yahoo to know about any necessary news. Also they love to browse websites like Wikipedia which is a full fledged
encyclopedia on Internet.

Social Networking: Social networking is a good medium to communicate with friends and family members. There
are many social networking sites like Face book, Twitter etc which are used by people in connecting with friends.

Communication: Communication is another way to use the Internet. People connect with others through various IM
services like GTalk, Skype and Yahoo messenger. There are lots of other services through which people send
messages.

Transfer of Files: People – school students, college students, office staff, businesspeople, everyone sends files through
the Internet. This is an essential part of their lives. These files are sent through the Internet. People use various mail
services like Gmail, Yahoo mail, Hotmail etc to send files.

Current News: It is either latest news, or Sport updates; people love to surf Internet to get live update of any news.
Websites like Rediff, NY times are quick news providing websites.

Entertainment: Internet and Entertainment are closely related. It could be in the form of watching videos in
YouTube, plying live games, or downloading movies, Internet provides its entertainment dominance everywhere.

Internet transactions: Now Internet can save time and money of the people. The facility is known as Internet
banking facility through which people can deposit any bill, transfer money through account, and also make Internet
reservation on time from their home.

Marketing: Internet marketers make extensive use of Internet to sell products. There are lots of social media
enthusiasts who promote others’ products online via various social media sites.

Online Education: This has developed very fast in most countries. Various websites offer online courses to learn
various things like designing, programs or subjects. Online education is very helpful to promote education in places
where the courses are not available easily. It also helps in spaced and paced learning.

Major Internet tools and services

Internet is a worldwide collection of networks. The Internet has different tools and services that are provided:

 E-mail
 Voice mail
 FTP
 WWW
 E-Commerce
 Chat
 Search Engine
 Electronic mail (email): E-mail is an electronic mail. The messages can be sent electronically over a network. For
sending or receiving an email, the user must have an email address; email address is given as:
username@location

 Username: It is the recipient’s email name.


 @: It is a character, which is used to separate the email name an location.
 Location: It is a place – the electronic post office, where the recipient’s mail is delivered and stored.
 Voice mail: Initially only text mails were being sent. If the voice information is to be sent or received, then the
user has to send it as an attachment file. But nowadays, the new technology allows us to send and receive the voice
data directly through the Internet as a voicemail. The only requirement is that computer should have a multimedia
facility and voice mail software.
 FTP (File Transfer Protocol): It is a fast application level TCP/IP protocol widely used for transferring both text-
based and binary files to and from remote systems through the Internet. Most of the people use FTP program for
downloading the software on the Internet.
 World Wide Web (WWW): In the Internet, different types of computer are connected to each other. These
computers may have different operating systems. When the data is to be transformed from one computer to other
computer and if the operating systems of both computers are different, then both operating systems should understand
the data format which is to be transferred. The www provides an interactive document and the software to access the
data on any computer.
 E-Commerce: Web technologies play a very important role in business. Websites are created to perform the
business. Online trading is now a very important feature of the Internet. It is also called as e-commerce. So the
geographical boundaries have become faint due to Internet and e-commerce.
 Chat: It is an Internet application. Using the program, the user needs to get connected in a chat. The user has to
log in the chat- room, get access in a particular chat room, find other users connected in a chat room and start chatting
with the users connected in that room.
 Search Engine: It is used to search the required information over the Internet. This is possible by getting the
home pages or websites dedicated to the particular subject. There are different types of search engines on the type of
search criteria for indexing pages and returning results. Size of the index, review of web pages, links with priorities,
net tags, importace of pages are the categories for getting the different search approaches of the search engines.

CLIENT/SERVER COMPUTING:-
According to MIS terminology, Client/Server computing is new technology that yields solutions to many data
management problems faced by modern organizations. The term Client/Server is used to describe a computing model
for the development of computerized systems. This model is based on distribution of functions between two types of
independent and autonomous processes: Server and Client. A Client is any process that requests specific services from
the server process. A Server is a process that provides requested services for the Client. Client and Server processes
can reside in same computer or in different computers linked by a network. When Client and Server processes reside
on two or more independent computers on a network, the Server can provide services for more than one Client. In
addition, a client can request services from several servers on the network without regard to the location or the
physical characteristics of the computer in which the Server process resides. The network ties the server and client
together, providing the medium through which the clients and the server communicate. The Fig. 1.1 given below
shows a basic Client/Server computing model.
From the Fig. 1.1 it is clear that services can be provided by variety of computers in the network. The key point
to Client/Server power is where the request processing takes place. For example: Client/Server Database. In case of
Client/Server database system, the functionality is split between the server system and multiple clients such that
networking of computers allows some tasks to be executed on the client system.

A Server for Every Client


A file server can store any type of data, and so on simpler systems, may be the only server necessary. On larger
and more complicated systems, the server responsibility may be distributed among several different types of servers.
In this section, we have discussed the purpose of various available server:

1. File Server

All the files reside on the server machine. File Server provides clients access to records within files from
the server machine. File Servers are useful for sharing files across a network among the different client
process requesting the services. The server process is somewhat primitive because of tends to demand
many message exchanges over the network to find the requested data.

The examples of File servers are: •

UNIX: Network File Services (NFS) created by Sun Micro systems.


• Microsoft Windows “Map Drive” e.g., Rivier College’s “P-drive”.
• Samba: An open Source/Free Software suite that provides seamless file and print services to SMB/CIFS
clients (i.e., Microsoft Windows clients).

2. Print Server

This machine manages user access to the shared output devices, such as printers. These are the earliest
type of servers. Print services can run on a file server or on one or more separate print server machines.

3. Application Server

This machine manages access to centralized application software; for example, a shared database. When
the user requests information from the database, the application server processes the request and returns
the result of the process to the user.

4. Mail Server

This machine manages the flow of electronic mail, messaging, and communication with mainframe
systems on large-scale networks.

5. Fax Server

Provides the facility to send and receive the Faxes through a single network connection. The Fax server
can be a workstation with an installed FAX board and special software or a specialized device dedicated
and designed for Fax Services. This machine manages flow of fax information to and from the network. It
is similar to the mail server.
6. Directory Services Server

It is found on large-scale systems with data that is distributed throughout multiple servers. This machine
functions as an organization manager, keeping track of what is stored where, enabling fast and reliable
access to data in various locations.

7. Web Server

This machine stores and retrieves Internet (and intranet) data for the enterprise. Some documents, data,
etc., reside on web servers. Web application provides access to documents and other data. “Thin” clients
typically use a web browser to request those documents. Such servers shares documents across intranets,
or across the Internet (or extranets). The most commonly used protocol is HTTP (Hyper Text Transfer
Protocol). Web application servers are now augmenting simple web servers. The examples of web
application servers are Microsoft’s Internet Information Server (IIS), Netscape’s iPlanet IBM’s
WebSphere, BEA’s WebLogic and Oracle Application Server.

8. Database Server

Data resides on server, in the form of a SQL database. Database server provides access to data to clients,
in response to SQL requests. It shares the data residing in a database across a network. Database Server
has more efficient protocol than File Server. The Database Server receives SQL requests and processes
them and returning only the requested data; therefore the client doesn’t have to deal with irrelevant data.
However, the client does have to implement SQL application code. The example of database server is:
Oracle9i database server.

9. Transaction Servers

The data and remote procedures reside on the server. The Server provides access to highlevel functions,
and implements efficient transaction processing. It shares data and highlevel functions across a network.
Transaction servers are often used to implement Online Transaction Processing (OLTP) in high-
performance applications. A transaction server utilizes a more efficient protocol in comparison to a
Database Server. The transaction Server receives high-level function request from the clients and it
implements that function. Often it needs to return less information to the client than a Database Server.
Examples of the Transaction servers mainly categorized as • TP-Light with Database Stored Procedures
like Oracle, Microsoft SQL Server etc. • TP-Heavy with TP Monitors like BEA Tuxedo, IBM CICS/TX
Seri
Core Java
Features of Java
The primary objective of Java programming language creation was to make it portable, simple
and secure programming language. Apart from this, there are also some excellent features which
play an important role in the popularity of this language. The features of Java are also known as
java buzzwords.

A list of most important features of Java language is given below.

1. Simple
2. Object-Oriented
3. Portable
4. Platform independent
5. Secured
6. Robust
7. Architecture neutral
8. Interpreted
9. High Performance
10. Multithreaded
11. Distributed

12. Dynamic

Operators in java
Operator in java is a symbol that is used to perform operations. For example: +, -, *, / etc.

There are many types of operators in java which are given below:

o Unary Operator,
o Arithmetic Operator,
o Shift Operator,
o Relational Operator,
o Bitwise Operator,
o Logical Operator,
o Ternary Operator and
o Assignment Operator.
Java Operator Precedence

perator Type Category Precedence

Unary postfix expr++ expr--

prefix ++expr --expr +expr -expr ~ !

Arithmetic multiplicative */%

additive +-

Shift shift <<>>>>>


Relational comparison <><= >= instanceof

equality == !=

Bitwise bitwise AND &

bitwise exclusive OR ^

bitwise inclusive OR |

Logical logical AND &&

logical OR ||

Ternary ternary ?:
Assignment assignment = += -= *= /= %= &= ^= |= <<= >>=
>>>=

Data Types in Java


Data types specify the different sizes and values that can be stored in the variable. There are two
types of data types in Java:

1. Primitive data types: The primitive data types include boolean, char, byte, short,
int, long, float and double.
2. Non-primitive data types: The non-primitive data types include
Classes, Interfaces, and Arrays.

Java Primitive Data Types

In Java language, primitive data types are the building blocks of data
manipulation. These are the most basic data types available in Java
language.

There are 8 types of primitive data types:

o boolean data type


o byte data type
o char data type
o short data type
o int data type
o long data type
o float data type
o double data type

Primitive Data Types Table – Default Value, Size, and Range


Data Type Default Value Default size Range
byte 0 1 byte or 8 bits -128 to 127
short 0 2 bytes or 16 bits -32,768 to 32,767
int 0 4 bytes or 32 bits 2,147,483,648 to 2,147,483,647
long 0 8 bytes or 64 bits 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
float 0.0f 4 bytes or 32 bits 1.4e-045 to 3.4e+038
double 0.0d 8 bytes or 64 bits 4.9e-324 to 1.8e+308
char ‘\u0000’ 2 bytes or 16 bits 0 to 65536
boolean FALSE 1 byte or 2 bytes 0 or 1

Java Variables
A variable is a container which holds the value while the java program is
executed. A variable is assigned with a datatype.

Variable is a name of memory location. There are three types of variables


in java: local, instance and static.

There are two types of data types in java: primitive and non-primitive.

1) Local Variable
A variable declared inside the body of the method is called local variable.
You can use this variable only within that method and the other methods
in the class aren't even aware that the variable exists.

A local variable cannot be defined with "static" keyword.

2) Instance Variable

A variable declared inside the class but outside the body of the method,
is called instance variable. It is not declared as static.
It is called instance variable because its value is instance specific and is
not shared among instances.

3) Static variable

A variable which is declared as static is called static variable. It cannot be


local. You can create a single copy of static variable and share among all
the instances of the class. Memory allocation for static variable happens
only once when the class is loaded in the memory.

Java Array

Normally, an array is a collection of similar type of elements that have a


contiguous memory location.

Java array is an object which contains elements of a similar data type.


It is a data structure where we store similar elements. We can store only
a fixed set of elements in a Java array.

Array in java is index-based, the first element of the array is stored at the 0 index.

Syntax to Declare an Array in Java

1. dataType[] arr; (or)


2. dataType []arr; (or)
3. dataType arr[];

Example of Java Array

//Java Program to illustrate how to declare, instantiate, initialize


//and traverse the Java array.
class Testarray{
public static void main(String args[]){
int a[]=new
int[5];//declaration and
instantiation
a[0]=10;//initialization
a[1]=20;
a[2]=70;
a[3]=40;
a[4]=50;
//traversing array
for(int i=0;i<a.length;i++)//length
is the property of array
System.out.println(a[i]);
}}

Java Methods
The method in Java or Methods of Java is a collection of statements that perform some specific task and return the
result to the caller. A Java method can perform some specific task without returning anything. Java Methods allow us
to reuse the code without retyping the code. In Java, every method must be part of some class that is different from
languages like C, C++, and Python.
1. A method is like a function i.e. used to expose the behavior of an object.
2. It is a set of codes that perform a particular task.

Syntax of Method
<access_modifier> <return_type> <method_name>( list_of_parameters)
{
//body
}
Advantage of Method
 Code Reusability
 Code Optimization

Method Declaration

In general, method declarations have 6 components:


1. Modifier: It defines the access type of the method i.e. from where it can be accessed in your
application. In Java, there 4 types of access specifiers.
 public: It is accessible in all classes in your application.
 protected: It is accessible within the class in which it is defined and in its subclass/es
 private: It is accessible only within the class in which it is defined.
 default: It is declared/defined without using any modifier. It is accessible within the same class and
package within which its class is defined.
Note: It is Optional in syntax.
2. The return type: The data type of the value returned by the method or void if does not return a value. It
is Mandatory in syntax.
3. Method Name: the rules for field names apply to method names as well, but the convention is a little
different. It is Mandatory in syntax.
4. Parameter list: Comma-separated list of the input parameters is defined, preceded by their data type,
within the enclosed parenthesis. If there are no parameters, you must use empty parentheses (). It
is Optional in syntax.
5. Exception list: The exceptions you expect by the method can throw, you can specify these
exception(s). It is Optional in syntax.
6. Method body: it is enclosed between braces. The code you need to be executed to perform your
intended operations. It is Optional in syntax.

Java Class
A class is a blueprint for the object. Before we create an object, we first need to define the class.
We can think of the class as a sketch (prototype) of a house. It contains all the details about the
floors, doors, windows, etc. Based on these descriptions we build the house. House is the object.
Since many houses can be made from the same description, we can create many objects
from a class.
Create a class in Java
We can create a class in Java using the class keyword. For example,

class ClassName {
// fields
// methods
}

Here, fields (variables) and methods represent the state and behavior of the object respectively.
 fields are used to store data
 methods are used to perform some operations
For our bicycle object, we can create the class as

class Bicycle {

// state or field
private int gear = 5;

// behavior or method
public void braking() {
System.out.println("Working of Braking");
}
}

In the above example, we have created a class named Bicycle . It contains a field named gear and
a method named braking() .
Here, Bicycle is a prototype. Now, we can create any number of bicycles using the prototype. And,
all the bicycles will share the fields and methods of the prototype.

Note: We have used keywords private and public . These are known as access modifiers. To learn
more, visit Java access modifiers.

Java Objects
An object is called an instance of a class. For example, suppose Bicycle is a class
then MountainBicycle , SportsBicycle , TouringBicycle , etc can be considered as objects of the class.
Creating an Object in Java

Here is how we can create an object of a class.

className object = new className();

// for Bicycle class


Bicycle sportsBicycle = new Bicycle();

Bicycle touringBicycle = new Bicycle();

We have used the new keyword along with the constructor of the class to create an object.
Constructors are similar to methods and have the same name as the class. For
example, Bicycle() is the constructor of the Bicycle class. To learn more, visit Java Constructors.
Here, sportsBicycle and touringBicycle are the names of objects. We can use them to access fields
and methods of the class.
As you can see, we have created two objects of the class. We can create multiple objects of a
single class in Java.

Note: Fields and methods of a class are also called members of the class.

Access Members of a Class

We can use the name of objects along with the . operator to access members of a class. For
example,

class Bicycle {

// field of class
int gear = 5;

// method of class
void braking() {
...
}
}

// create object
Bicycle sportsBicycle = new Bicycle();

// access field and method


sportsBicycle.gear;
sportsBicycle.braking();

In the above example, we have created a class named Bicycle . It includes a field named gear and a
method named braking() . Notice the statement,

Bicycle sportsBicycle = new Bicycle();

Here, we have created an object of Bicycle named sportsBicycle . We then use the object to access
the field and method of the class.
 sportsBicycle.gear - access the field gear

 sportsBicycle.braking() - access the method braking()

We have mentioned the word method quite a few times. You will learn about Java methods in
detail in the next chapter.
Inheritance in Java
Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors
of a parent object. It is an important part of OOPs (Object Oriented programming system).

The idea behind inheritance in Java is that you can create new classes that are built upon existing
classes. When you inherit from an existing class, you can reuse methods and fields of the parent
class. Moreover, you can add new methods and fields in your current class also.

Inheritance represents the IS-A relationship which is also known as a parent-child relationship.
Important Terminologies Used in Java Inheritance
 Class: Class is a set of objects which shares common characteristics/ behavior and common properties/ attributes.
Class is not a real-world entity. It is just a template or blueprint or prototype from which objects are created.
 Super Class/Parent Class: The class whose features are inherited is known as a superclass(or a base class or a
parent class).
 Sub Class/Child Class: The class that inherits the other class is known as a subclass(or a derived class, extended
class, or child class). The subclass can add its own fields and methods in addition to the superclass fields and
methods.
 Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to create a new class and there is
already a class that includes some of the code that we want, we can derive our new class from the existing class. By
doing this, we are reusing the fields and methods of the existing class.

Why use inheritance in java


o For Method Overriding (so runtime polymorphism can be achieved).
o For Code Reusability.

The syntax of Java Inheritance


class Subclass-name extends Superclass-name
{
//methods and fields
}

Example:
class Employee{
float salary=40000;
}
class Programmer extends Employee{
int bonus=10000;
public static void main(String
args[]){ Programmer p=new
Programmer();
System.out.println("Programmer salary is:"+p.salary);
System.out.println("Bonus of Programmer
is:"+p.bonus);
}
}
JAVA Package
A java package is a group of similar types of classes, interfaces and sub-packages.
Package in java can be categorized in two form, built-in package and user-defined
package. There are many built-in packages such as java, lang, awt, javax, swing, net, io,
util, sql etc. Here, we will have the detailed learning of creating and using user-defined
packages.

Advantage of Java Package

1) Java package is used to categorize the classes and interfaces so that they can
be easily maintained.

2) Java package provides access protection.

3) Java package removes naming collision.

Simple example of java package

The package keyword is used to create a package in java.

//save as
Simple.java
package
mypack;
public class
Simple{
public static void main(String args[]){
System.out.println("Welcome to
package");
}
}

Interface in Java
An interface in java is a blueprint of a class. It has static constants and abstract methods.

The interface in Java is a mechanism to achieve abstraction. There can be only abstract
methods in the Java interface, not method body. It is used to achieve abstraction and
multiple inheritance in Java.

In other words, you can say that interfaces can have abstract methods and variables. It
cannot have a method body.

Java Interface also represents the IS-A

relationship. It cannot be instantiated just like


the abstract class.

Since Java 8, we can have default and static methods in an

interface. Since Java 9, we can have private methods in an

interface.
Why use Java interface?

There are mainly three reasons to use interface. They are given below.

o It is used to achieve abstraction.


o By interface, we can support the functionality of multiple inheritance.
o It can be used to achieve loose coupling.

Syntax:
interface <interface_name>{

// declare constant fields


// declare methods that abstract
// by default.
}

Java Interface Example

In this example, the Printable interface has only one method, and its implementation is provided
in the A6 class.

interface printable{
void print();
}
class A6 implements printable{
public void print(){System.out.println("Hello");}

public static void main(String args[]){


A6 obj = new A6();
obj.print();
}
}

Exception Handling in Java


The Exception Handling in Java is one of the powerful mechanism to handle the runtime
errors so that normal flow of the application can be maintained.

In this page, we will learn about Java exceptions, its type and the difference between checked
and unchecked exceptions.

What is Exception in Java

Dictionary Meaning: Exception is an abnormal condition.


In Java, an exception is an event that disrupts the normal flow of the program. It is an object
which is thrown at runtime.

Advantage of Exception Handling

The core advantage of exception handling is to maintain the normal flow of the application.
An exception normally disrupts the normal flow of the application that is why we use exception
handling.

Java Exception Keywords

There are 5 keywords which are used in handling exceptions in Java.

Keyword Description
try The "try" keyword is used to specify a block where we should place
exception code. The try block must be followed by either catch or
finally. It means, we can't use try block alone.
catch The "catch" block is used to handle the exception. It must be
preceded by try block which means we can't use catch block alone. It
can be
followed by finally block later.
finally The "finally" block is used to execute the important code of the
program. It is executed whether an exception is handled or not.
throw The "throw" keyword is used to throw an exception.
throws The "throws" keyword is used to declare exceptions. It doesn't throw an
exception. It specifies that there may occur an exception in the method.
It is always used with method signature.

Multithreading in Java
Multithreading in java is a process of executing multiple threads simultaneously.

A thread is a lightweight sub-process, the smallest unit of processing. Multiprocessing and


multithreading, both are used to achieve multitasking.

However, we use multithreading than multiprocessing because threads use a shared memory
area. They don't allocate separate memory area so saves memory, and context-switching between
the threads takes less time than process.

Java Multithreading is mostly used in games, animation, etc.


Advantages of Java Multithreading

1) It doesn't block the user because threads are independent and you can perform
multiple operations at the same time.

2) You can perform many operations together, so it saves time.

3) Threads are independent, so it doesn't affect other threads if an exception occurs in a


single thread.

Life cycle of a Thread (Thread States)

A thread can be in one of the five states. According to sun, there is only 4 states in thread life
cycle in java new, runnable, non-runnable and terminated. There is no running state.

But for better understanding the threads, we are explaining it in the 5 states.

The life cycle of the thread in java is controlled by JVM. The java thread states are as follows:

1. New
2. Runnable
3. Running
4. Non-Runnable (Blocked)
5. Terminated

Java Applet
Applet is a special type of program that is embedded in the webpage to generate the dynamic
content. It runs inside the browser and works at client side.

Advantage of Applet

There are many advantages of applet. They are as follows:

o It works at client side so less response time.


o Secured
o It can be executed by browsers running under many plateforms, including
Linux, Windows, Mac Os etc.

Drawback of Applet
o Plugin is required at client browser to execute applet.

Lifecycle of Java Applet


1. Applet is initialized.
2. Applet is started.
3. Applet is painted.
4. Applet is stopped.
5. Applet is destroyed.

Simple Applet
import java.awt.*;
import java.applet.*;
public class Simple extends Applet
{
public void paint(Graphics g)
{
g.drawString("A simple Applet", 20, 20);
}
}

String in Java
A string is a collection of characters. In Java, a string is an object that represents a collection of objects. A
string is a predefined class used to create string objects. It is an immutable object, which means it can’t be
updated once created.

The string class has a set of built-in-methods, defined below.

 charAt(): It returns a character at a specified position.


 equals(): It compares the two given strings and returns a Boolean, that is, True or False.
 concat(): Appends one string to the end of another.
 length(): Returns the length of a specified string.
 toLowerCase(): Converts the string to lowercase letters.
 toUpperCase(): Converts the string to uppercase letters.
 indexOf(): Returns the first found position of a character.
 substring(): Extracts the substring based on index values, passed as an argument
Code for String

class Main{
public static void main(String []args)
{
String s1="Adithya";
String s2="Adithya";
String s3="Adi";
boolean x=s1.equals(s2);
System.out.println("Compare s1 and s2:"+x);
System.out.println("Character at given position is:"+s1.charAt(5));
System.out.println(s1.concat(" the author"));
System.out.println(s1.length());
System.out.println(s1.toLowerCase());
System.out.println(s1.toUpperCase());
System.out.println(s1.indexOf('a'));
System.out.println(s1.substring(0,4));
System.out.println(s1.substring(4));
}
}

Code explanation
 Lines 4-6: We create three strings s1, s2, and s3.
 Line 7: We compare two strings s1 and s2 using equals() function.
 Line 9: We find the character at position 5 in string s1 using charAt() function and print it.
 Line 10: We concatenate two strings using the concat() function.
 Line 11: We find the length of string s1 using length() function.
 Line 12: We convert the string s1 to lowercase letters using toLowerCase() function.
 Line 13: We convert the string s1 to uppercase letters using toUpperCase() function.
 Line 14: We find the index of a in string s1 using indexOf() function.
 Lines 15-16: We find the substring by passing indexes as parameters to the substring() function.

Event Handling in Java


Many event listeners are frequently used; recall the click of a button that takes you to another website or the mouse
scroll? All of this is accomplished through the use of various event handlers, and the mechanism is known as event
handling.

Events in Java

Events in Java represent the change in the state of any object. Events occur when the user interacts with the interface.
Clicking a button, moving the mouse, typing a character, selecting an item from a list, and scrolling the page are all
examples of behaviors that cause an event to occur.

Types of Events in Java:

Foreground Events: These events necessitate the user's direct participation. They are produced as a result of a user
interacting with graphical components in a Graphical User Interface.

Background Events: Background events are those that require end-user interaction. Operating system interrupts and
hardware or software failures are examples of background events.

Event handling in Java is the process of controlling an event and taking appropriate action if one occurs.
Components of Event Handling in Java

An Event Model is fundamentally composed of the three elements listed below:

 Events Handler
 Event Sources
 Event Listeners

In the subsequent sections, we will go over each one in-depth.

1. Event Handler

An event handler is a function or method that executes program statements in response to an event. A software
program that processes activities such as keystrokes and mouse movements is what an event handler is. Event
handlers in Web sites make Web content dynamic.

2. Event Sources

An object on which an event occurs is referred to as a source. The source is in charge of informing the handler
about the event that occurred. There are various sources like buttons, checkboxes, lists, menu-item, choices,
scrollbars, text components, windows, etc.

3. Event Listeners

When an event occurs, an object named an event listener is called. The listeners need two things: first, they must
be registered with a source; however, they can be registered with multiple sources to receive event notifications.

Second, it must put in place the methods for receiving and processing notifications. A set of interfaces defines
the methods for dealing with events. The Java.awt.event package contains the following event classes and
interfaces.

Event Classes and Listener Interfaces in Java

Event Classes Description Listener Interface


When a button is clicked or a list item is double-clicked, an
ActionEvent ActionListener
ActionEvent is triggered.
MouseEvent This event indicates a mouse action occurred in a component MouseListener
The Key event is triggered when the character is entered using the
KeyEvent KeyListener
keyboard.
ItemEvent An event that indicates whether an item was selected or not. ItemListener
TextEvent when the value of a textarea or text field is changed TextListener
MouseWheelEven
generated when the mouse wheel is rotated MouseWheelListener
t
The object of this class represents the change in the state of a window
WindowEvent and are generated when the window is activated, deactivated, WindowListener
deiconified, iconified, opened or closed
ComponentEvent when a component is hidden, moved, resized, or made visible ComponentEventListener
ContainerEvent when a component is added or removed from a container ContainerListener
AdjustmentEvent when the scroll bar is manipulated AdjustmentListener
FocusEvent when a component gains or loses keyboard focus FocusListener
Java AWT:- Java AWT or Abstract Window Toolkit is an API used for developing GUI(Graphic User
Interfaces) or Window-Based Applications in Java. Java AWT is part of the Java Foundation Classes (JFC) that
provides a way to build platform-independent graphical applications.
In this AWT tutorial, you will learn the basics of the AWT, including how to create windows, buttons, labels, and
text fields. We will also learn how to add event listeners to components so that they can respond to user input.
By the end of this tutorial, you will have a good understanding of the AWT and be able to create simple GUIs
in Java.
Java AWT Basics
Java AWT (Abstract Window Toolkit) is an API used to create Graphical User Interface (GUI) or Windows-based
Java programs and Java AWT components are platform-dependent, which means they are shown in accordance
with the operating system’s view. AWT is heavyweight, which means that its components consume resources from
the underlying operating system (OS). The java.awt package contains AWT API classes such as TextField, Label,
TextArea, RadioButton, CheckBox, Choice, List, and so on.
Why AWT is Platform Independent?
The Java AWT utilizes the native platform subroutine to create API components such as TextField, CheckBox, and
buttons. This results in a different visual format for these components on different platforms such as Windows,
MAC OS, and Unix. The reason for this is that each platform has a distinct view of its native components. AWT
directly calls this native subroutine to create the components, resulting in an AWT application resembling a
Windows application on Windows OS, and a Mac application on the MAC OS. In simpler terms, the AWT
application’s appearance adapts to the platform it is running on.
AWT is platform independent even after the AWT components are platform dependent because of the points
mentioned below:
1. JVM (Java Virtual Machine):
As Java Virtual Machine is platform dependent
2. Abstract APIs:
AWT provides an abstract layer for GUI. Java applications interact with AWT through Abstract API which are
platform independent. Abstract API allows Java to isolate platform-specific details, making code portable across
different systems.
3. Platform-Independent Libraries:
The Libraries of AWT are written in Java which they are totally platform-independent. Because of this, it ensures
that AWT functionality remains consistent across different environments.
Java AWT Hierarchy

 Components: AWT provides various components such as buttons, labels, text fields, checkboxes, etc used for
creating GUI elements for Java Applications.
 Containers: AWT provides containers like panels, frames, and dialogues to organize and group components in
the Application.
 Layout Managers: Layout Managers are responsible for arranging data in the containers sone of the layout
managers are BorderLayout, FlowLayout, etc.
 Event Handling: AWT allows the user to handle the events like mouse clicks, key presses, etc. using event
listeners and adapters.
 Graphics and Drawing: It is the feature of AWT that helps to draw shapes, insert images and write text in the
components of a Java Application.
Note: Container can be added inside another container as it is type of component.

Types of Containers in Java AWT


There are four types of containers in Java AWT:
1. Window: Window is a top-level container that represents a graphical window or dialog box. The Window class
extends the Container class, which means it can contain other components, such as buttons, labels, and text
fields.
2. Panel: Panel is a container class in Java. It is a lightweight container that can be used for grouping other
components together within a window or a frame.
3. Frame: The Frame is the container that contains the title bar and border and can have menu bars.
4. Dialog: A dialog box is a temporary window an application creates to retrieve user input.

Java AWT Controls


Learn the basics of the Abstract Window Toolkit (AWT) in Java, for both beginners and experienced developers.
 Java AWT Label
 Java AWT Button
 Java AWT TextField
 Java AWT Checkbox
 Java AWT CheckboxGroup
 Java AWT Choice
 Java AWT List
 Java AWT Canvas
 AWT Scrollbar
 Java AWT MenuItem & Menu
 Java AWT PopupMenu
 Java AWT Panel
 Java AWT Toolkit

1. Java AWT Label


Syntax of AWT Label
public class Label extends Component implements Accessible

AWT Label Class Constructors


There are three types of Java AWT Label Class
1. Label():
Creates Empty Label.
2. Label(String str):
Constructs a Label with str as its name.
3. Label(String str, int x):
Constructs a label with the specified string and x as the specified alignment

2. Java AWT Button


AWT Button is a control component with a label that generates an event when clicked on. Button Class is used for
creating a labeled button that is platform-independent.
Syntax of AWT Button
public class Button extends Component implements Accessible

Java AWT Button Class Constructors


There are two types of Button class constructors as mentioned below:
1. Button( ):
Creates a Button with no label i.e. showing an empty box as a button.
2. Button(String str):
Creates a Button with String str as a label. For example if str=”Click Here” button with show click here as the value.
3. Java AWT TextField
Syntax of AWT TextField:
public class TextField extends TextComponent

TextField Class constructors


There are TextField class constructors are mentioned below:
1. TextField():
Constructs a TextField component.
2. TextField(String text):
Constructs a new text field initialized with the given string str to be displayed.
3. TextField(int col):
Creates a new text field(empty) with the given number of columns (col).
4. TextField(String str, int columns):
Creates a new text field(with String str in the display) with the given number of columns (col).

4. Java AWT Checkbox


Syntax of AWT Checkbox:
public class Checkbox extends Component implements ItemSelectable, Accessible

Checkbox Class Constructors


There are certain constructors in the AWT Checkbox class as mentioned below:
1. Checkbox():
Creates a checkbox with no label.
2. Checkbox(String str):
Creates a checkbox with a str label.
3. Checkbox(String str, boolean state, CheckboxGroup group):
Creates a checkbox with the str label, and sets the state in the mentioned group.

5. Java AWT CheckboxGroup


CheckboxGroup Class is used to group together a set of Checkbox.
Syntax of AWT CheckboxGroup:
public class CheckboxGroup extends Object implements Serializable

Note: CheckboxGroup enables the use of radio buttons in AWT.

6. Java AWT Choice


The object of the Choice class is used to show a popup menu of choices.
Syntax of AWT Choice:
public class Choice extends Component implements ItemSelectable, Accessible

AWT Choice Class constructor


Choice(): It creates a new choice menu.

7. Java AWT List


The object of the AWT List class represents a list of text items.
Syntax of Java AWT List:
public class List extends Component implements ItemSelectable, Accessible

AWT List Class Constructors


The List of class constructors is defined below:
1. List():
Creates a new list.
2. List(int row):
Creates lists for a given number of rows(row).
3. List(int row, Boolean Mode)
Ceates new list initialized that displays the given number of rows.
8. Java AWT Canvas
Syntax of AWT Canvas:
public class Canvas extends Component implements Accessible

Canvas Class Constructors


1. Canvas():
Creates new Canvas.
2. Canvas(GraphicConfiguration config):
It creates a new Canvas with the given Graphic configuration.

9. AWT Scrollbar
Syntax of AWT Scrollbar:
public class Scrollbar extends Component implements Adjustable, Accessible

Java AWT Scrollbar Class Constructors


There are three constructor classes in Java mentioned below:
1. Scrollbar():
It Creates a new vertical Scrollbar in the Application.
2. Scrollbar(int orientation):
Creates a new vertical Scrollbar with the given orientation.
3. Scrollbar(int orientation, int value, int visible, int mini, int maxi):
Creates a new scrollbar with the orientation mentioned with value as the default value and [mini, maxi] as the
lower and higher limit.

10. Java AWT MenuItem & Menu


MenuItem class adds a simple labeled menu item on the menu. The MenuItem class allows you to create individual
items that can be added to menus. And Menu is a component used to create a dropdown menu that can contain a
list of MenuItem components.
Syntax of Java AWT MenuItem
public class MenuItem extends MenuComponent implements Accessible

Syntax of Java AWT Menu


public class Menu extends MenuItem implements MenuContainer, Accessible

Java AWT PopupMenu is a component that is used for dynamically popping up a menu that appears when the user
right-clicks or performs any other action on a component.
Syntax of AWT PopupMenu
public class PopupMenu extends Menu implements MenuContainer, Accessible

12. Java AWT Panel


Java AWT Panel is a container class used to hold and organize graphical components in a Java Application.
Syntax of Java AWT Panel:
public class Panel extends Container implements Accessible

13. Java AWT Toolkit


Java AWT Toolkit class provides us with a platform-independent way to access various system resources and
functionalities. Subclasses of Toolkit are used to bind various components.
Syntax of Java AWT Toolkit
public abstract class Toolkit extends Object
Java Layout manager:- The Layout managers enable us to control the way in which visual
components are arranged in the GUI forms by determining the size and position of components within the
containers.

Types of LayoutManager

There are 6 layout managers in Java

 FlowLayout: It arranges the components in a container like the words on a page. It fills the top line
from left to right and top to bottom. The components are arranged in the order as they are added i.e. first
components appears at top left, if the container is not wide enough to display all the components, it is
wrapped around the line. Vertical and horizontal gap between components can be controlled. The
components can be left, center or right aligned.
 BorderLayout: It arranges all the components along the edges or the middle of the container i.e. top,
bottom, right and left edges of the area. The components added to the top or bottom gets its preferred
height, but its width will be the width of the container and also the components added to the left or right
gets its preferred width, but its height will be the remaining height of the container. The components added
to the center gets neither its preferred height or width. It covers the remaining area of the container.
 GridLayout: It arranges all the components in a grid of equally sized cells, adding them from the left to
right and top to bottom. Only one component can be placed in a cell and each region of the grid will have
the same size. When the container is resized, all cells are automatically resized. The order of placing the
components in a cell is determined as they were added.
 GridBagLayout: It is a powerful layout which arranges all the components in a grid of cells and maintains
the aspect ration of the object whenever the container is resized. In this layout, cells may be different in
size. It assigns a consistent horizontal and vertical gap among components. It allows us to specify a default
alignment for components within the columns or rows.
 BoxLayout: It arranges multiple components in either vertically or horizontally, but not both. The
components are arranged from left to right or top to bottom. If the components are aligned horizontally,
the height of all components will be the same and equal to the largest sized components. If the components
are aligned vertically, the width of all components will be the same and equal to the largest width
components.
 CardLayout: It arranges two or more components having the same size. The components are arranged in
a deck, where all the cards of the same size and the only top card are visible at any time. The first
component added in the container will be kept at the top of the deck. The default gap at the left, right, top
and bottom edges are zero and the card components are displayed either horizontally or vertically.

You might also like