You are on page 1of 26

UNIT-1

Introduction: Introduction and Web Development Strategies, History of Web and Internet,
Protocols Governing Web, Writing Web Projects, Connecting to Internet, Introduction to Internet
services and tools, Introduction to client-server computing.

Core Java: Introduction, Operator, Data type, Variable, Arrays, Methods & Classes, Inheritance,
Package and Interface, Exception Handling, Multithread programming, I/O, Java Applet, String
handling, Event handling, Introduction to AWT, AWT controls, Layout managers

Topic-1: Web Technology


Web Technology refers to the various tools and techniques that are utilized in the process of
communication between different types of devices over the Internet. A web browser is used to
access web pages. Web browsers can be defined as programs that display text, data, pictures,
animation, and video on the Internet. Hyperlinked resources on the World Wide Web can be
accessed using software interfaces provided by Web browsers.
Web Technology can be Classified into the Following Sections:
 World Wide Web (WWW): The World Wide Web is based on several different
technologies: Web browsers, Hypertext Markup Language (HTML), and Hypertext
Transfer Protocol (HTTP).
 Web Browser: The web browser is an application software to explore www (World
Wide Web). It provides an interface between the server and the client and requests
to the server for web documents and services.
 Web Server: Web server is a program which processes the network requests of the
users and serves them with files that create web pages. This exchange takes place
using Hypertext Transfer Protocol (HTTP).
 Web Pages: A webpage is a digital document that is linked to the World Wide Web
and viewable by anyone connected to the internet has a web browser.
 Web Development: Web development refers to the building, creating, and
maintaining of websites. It includes aspects such as web design, web publishing,
web programming, and database management. It is the creation of an application
that works over the internet i.e. websites.
Web Development can be Classified into Two Ways:
 Frontend Development: The part of a website that the user interacts directly is
termed as front end. It is also referred to as the ‘client side’ of the application.
Backend Development: Backend is the server side of a website. It is the part of the website
that users cannot see and interact. It is the portion of software that does not come in direct
contact with the users. It is used to store and arrange data.

Frontend Development Languages


The front-end portion is built by using some languages which are discussed below:
 HTML: HTML stands for Hypertext Markup Language. It is used to design the
front-end portion of web pages using a markup language. HTML is the combination
of Hypertext and Markup language. Hypertext defines the link between the web
pages. The markup language is used to define the text documentation within the tag
which defines the structure of web pages.
 CSS: Cascading Style Sheets fondly referred to as CSS is a simply designed
language intended to simplify the process of making web pages presentable. CSS
allows you to apply styles to web pages. More importantly, CSS enables you to do
this independent of the HTML that makes up each web page.
 JavaScript: JavaScript is a famous scripting language used to create magic on the
sites to make the site interactive for the user. It is used to enhancing the
functionality of a website to running cool games and web-based software.
 AJAX: Ajax is an acronym for Asynchronous Javascript and XML. It is used to
communicate with the server without refreshing the web page and thus increasing
the user experience and better performance.
Backend Development Languages
The back end portion is built by using some languages which are discussed below:
 PHP: PHP is a server-side scripting language designed specifically for web
development. Since PHP code executed on the server-side, so it is called a server-
side scripting language.
 Node.js: Node.js is an open-source and cross-platform runtime environment for
executing JavaScript code outside a browser. You need to remember that NodeJS is
not a framework, and it’s not a programming language. Most people are confused
and understand it’s a framework or a programming language. We often use Node.js
for building back-end services like APIs like Web App or Mobile App. It’s used in
production by large companies such as Paypal, Uber, Netflix, Wallmart, and so on.
 Python: Python is a programming language that lets you work quickly and integrate
systems more efficiently.
 Ruby: Ruby is a dynamic, reflective, object-oriented, general-purpose
programming language. Ruby is a pure Object-Oriented language developed by
Yukihiro Matsumoto. Everything in Ruby is an object except the blocks but there
are replacements too for it i.e procs and lambda. The objective of Ruby’s
development was to make it act as a sensible buffer between human programmers
and the underlying computing machinery.
 Java: Java is one of the most popular and widely used programming languages and
platforms. It is highly scalable. Java components are easily available.
 JavaScript: JavaScript can be used as both (front end and back end) programming.
 Golang: Golang is a procedural and statically typed programming language having
the syntax similar to C programming language. Sometimes it is termed as Go
Programming Language.
 C#: C# is a general-purpose, modern and object-oriented programming language
pronounced as “C sharp”.
 DBMS: The software which is used to manage database is called Database
Management System (DBMS).
Web Protocols
Web protocols are set of rules followed by everyone communicating over the web.
 HTTP: The Hypertext Transfer Protocol (HTTP) is designed to enable
communications between clients and servers. HTTP works as a request-response
protocol between a client and server. A web browser may be the client, and an
application on a computer that hosts a web site may be the server.
 Other Protocols:
 TCP/IP Model
 UDP
 FTP
 SMTP
 SOAP
Topic2: Web Development Strategies are the blueprint for crafting not just functional websites
but exceptional ones that leave a lasting impression.

As technology evolves, so do the strategies employed by web developers to create innovative,


user-friendly, and efficient websites. More than font, color, and layout there are some other
important strategies to be followed in building a website.

Strategy 1: Responsive Web Design


Responsive Web Design (RWD) is a crucial web development strategy that addresses the diverse
landscape of devices. It guarantees fluid adjustment to different screen sizes, enhancing the
user’s experience. Websites that adopt RWD increase customer happiness, boost search engine
rankings, and simplify maintenance. The method simplifies development and guarantees
consistent performance across platforms by doing away with the requirement for distinct desktop
and mobile versions. RWD has emerged as a key technique for building adaptable, user-friendly,
and highly effective websites at a time when people access content on a variety of devices.

Strategy 2: Progressive Web Apps (PWAs)


Progressive online Apps (PWAs) offer quick loading times, offline capabilities, and an app-like
user interface by combining online and mobile app features. PWAs provide a stable and
interesting user experience by using service workers and modern web capabilities. This approach
gives developers the ability to create cross-platform apps that work on a variety of devices.
Adopting PWAs is a proactive website development strategy that will increase user happiness
and reach in the dynamic world of digital experiences.

Strategy 3: Cross-Browser Compatibility


In web development, cross-browser compatibility is essential to provide a smooth user
experience across various browsers, including Chrome, Firefox, Safari, and Edge. Thorough
testing ensures that many users experience consistent functioning and appearance. To produce
websites that function as well as possible across many platforms and browsers, developers may
work more efficiently using tools like BrowserStack and CrossBrowserTesting, which ease the
cross-browser testing process. This tactic is essential for preserving accessibility and user
happiness while keeping up with the ever-changing digital scene.

Strategy 4: Mobile-First Development


Given how commonplace mobile devices are becoming, it is strategically vital to develop mobile
applications first. This website development strategy comprises developing websites for mobile
devices and bigger displays. This approach prioritizes mobile optimization, which improves
overall performance and puts important materials front and center. Understanding that most users
access the internet via smartphones, mobile-first development conforms to user preferences to
provide a more personalized and improved online experience for the mobile-first users.

Strategy 5: Content Management Systems (CMS)


Web developers rely heavily on material Management Systems (CMS) like WordPress, Joomla,
and Drupal, which give them effective tools for creating, editing, and managing digital material.
These tools ease the creation process and simplify updating information and customizing
websites. Taking into account aspects like security, scalability, and the website’s particular
needs, choosing the right content management system is essential. The effectiveness of the web
development process is improved overall by CMS systems’ many capabilities and user-friendly
interfaces, which greatly aid in the smooth optimization and upkeep of websites.

Strategy 6: Application Programming Interfaces (APIs)


Web development requires Application Programming Interfaces (APIs), facilitating simple
communication between various software systems. APIs are used by developers to easily
incorporate features and services from third parties into their websites, increasing productivity
and creativity. Prominent APIs such as the Twitter API and the Google Maps API enable
developers to add various features without duplicating them. This expedites development and
improves the usefulness of online apps overall. APIs are essential for developing dynamic,
feature-rich online experiences because they offer a common interface for various software
components to communicate and work together.

Strategy 7: Search Engine Optimization (SEO)


A website’s success depends on search engine optimization (SEO), which ensures high exposure
on search engines to draw in organic visitors. Web developers need to understand SEO
fundamentals, optimize meta tags, use descriptive URLs, and produce highly caliber content.
Tools like Moz and Google Analytics make monitoring and optimizing SEO performance easier.
Developers may raise a website’s search engine position, increase organic traffic, and improve
user experience by carefully implementing these strategies.
Topic3:
Topic4: Writing Web Projects

Topic 5: Connecting to the Internet

A device has to be connected to the Internet before you can access it. If you plan to use the
Internet at home, you'll usually need to purchase an Internet connection from an Internet service
provider, which will likely be a phone company, cable company, or the government. Other
devices usually connect through Wi-Fi or cellular Internet connections. Sometimes libraries,
cafes, and schools offer free Wi-Fi for their patrons, customers, and students.

How to connect your computer to the Internet?

To establish the connection follow the following steps:


Step 1: Install the hardware, such as a modem and an Ethernet cable, as well as the important
software like LAN driver, etc.
Step 2: Use an ethernet cable or a wireless link to establish a preliminary connection.
Step 3: Navigate to the router’s default IP address.
Step 4: Use the login name and password provided by the ISP to connect to the internet.
Step 5: Save your preferences.

Browsing the web

Most information on the Internet is on websites. Once you are connected to the Internet, you can
access websites using a kind of application called a web browser.

A website is a collection of related text, images, and other resources. Websites can resemble
other forms of media—like newspaper articles or television programs—or they can be interactive
in a way that's unique to computers. The purpose of a website can be almost anything: a news
platform, an advertisement, an online library, a forum for sharing images, or an educational site.

A web browser allows you to connect to and view websites. The web browser itself is not the
Internet, but it displays pages on the Internet. Each website has a unique address. By typing this
address into your web browser, you can connect to that website and your web browser will
display it.

Navigating websites

Websites often have links to other sites, also called hyperlinks. These are often parts of the text
on the website. They are usually colored blue, and sometimes they are underlined or bold. If you
click the text, your browser will load a different page. Web authors use hyperlinks to connect
relevant pages. This web of links is one of the most unique features of the Internet, lending to the
old name World Wide Web.

Each website has a unique address, called a URL. You'll notice that when you click a link, the
URL changes as your browser loads a new page. If you type a URL in the address bar in your
browser, your browser will load the page associated with that URL. It's like a street address,
telling your browser where to go on the Internet.

Topic 6: Introduction to Internet services and tools


The internet offers a range of services to its consumers. We can upload and download the files/
data via the internet as it is a pool of knowledge. We can access or obtain information as
needed. It is quite popular because of the variety of senders available on the Internet. Web
services have grown in popularity as a result of these offerings. To access/exchange a large
amount of data such as software, audio clips, video clips, text files, other documents, etc., we
require internet services. We must use an Internet service to connect to the Internet. Data can
be sent from Internet servers to your machine via Internet service. Some of the internet
services are FTP, Telnet, VoIP, etc. In this article, we will learn about different types of
internet services.

Internet services

To access/exchange a large amount of data such as software, audio clips, video clips, text files,
other documents, etc., we need internet services. You must use an Internet service to connect to
the Internet. Data can be sent from Internet servers to your machine via Internet service. Some
of the commonly used internet services are :
 Communication Services
 Information Retrieval Services
 File Transfer
 World Wide Web Services
 Web Services
 Directory Services
 Automatic Network Address Configuration
 Network Management Services
 Time Services
 Usenet
 NewsGroup
 Ecommerce
Now let us discuss them one by one
1. Communication Services: To exchange data/information among individuals or
organizations, we need communication services. Following are some of the common
communication services:
 IRC(Internet Relay Chat): Subscribers can communicate in real-time by
connecting numerous computers in public spaces called channels.
 VoIP: It stands for Voice over Internet Protocol, which describes how to make and
receive phone calls over the internet. A larger number of people believe VoIP is a
viable alternative to traditional landlines. VoIP (Voice over Internet Protocol) is a
technique that helps us make voice calls via the Internet rather than over a
traditional (or analog) phone line. Some VoIP services may let you call only other
VoIP users, while others may let you call anyone with a phone number, including
long-distance, mobile, and local/international lines. If you have an internet
connection you can easily call anyone without using a local phone service because
VoIP solutions are based on open standards, they can be used on any computer.
More than just setting up calls is what VoIP service providers do. Outgoing and
incoming calls are routed through existing telephone networks by them.
 List Server (LISTSERV): Delivers a group of email recipients’ content-specific
emails.
 E-Mail: Used to send electronic mail via the internet. It is a paperless method for
sending text, images, documents, videos, etc from one person to another via the
internet.
 User Network (USENET): It hosts newsgroups and message boards on certain
topics, and it is mostly run by volunteers.
 Telnet: It’s used to connect to a remote computer that’s connected to the internet.
 Video Conferencing: Video conferencing systems allow two or more people who
are generally in different locations to connect live and visually. Live video
conferencing services are necessary for simulating face-to-face talks over the
internet. The system can vary from very simple to complex, depending on the live
video conferencing vendors. A live video-based conference involves two or more
individuals in separate locations utilizing video-enabled devices and streaming
voice, video, text, and presentations in real-time via the internet. It allows numerous
people to connect and collaborate face to face over large distances. Tools available
for this purpose are Zoom, FreeConference, Google Hangouts, Skype, etc.
2. Information Retrieval Services: It is the procedure for gaining access to information/data
stored on the Internet. Net surfing or browsing is the process of discovering and obtaining
information from the Internet. When your computer is linked to the Internet, you may begin
retrieving data. To get data, we need a piece of software called a Web browser. A print or
computer-based information retrieval system searches for and locates data in a file, database,
or other collection of data. Some sites are:
 www.geeksforgeeks.org: Free tutorials, millions of articles, live, online, and
classroom courses, frequent coding competitions, industry expert webinars,
internships, and job possibilities are all available. A computer-based system for
searching and locating data in a file, database, or another source.
 www.crayola.com: It includes advice for students, parents, and educators on how
to be more creative.
3. File Transfer: The exchange of data files across computer systems is referred to as file
transfer. Using the network or internet connection to transfer or shift a file from one computer
to another is known as file transfer. To share, transfer, or send a file or logical data item across
several users and/or machines, both locally and remotely, we use file transfer. Data files
include – documents, multimedia, pictures, text, and PDFs and they can be shared by
uploading or downloading them. To retrieve information from the internet, there are various
services available such as:
 Gopher: A file retrieval application based on hierarchical, distributed menus that is
simple to use.
 FTP (File Transfer Protocol): To share, transfer, or send a file or logical data item
across several users and/or machines, both locally and remotely.
 Archie: A file and directory information retrieval system that may be linked to FTP
4. Web services: Web services are software that uses defined messaging protocols and are
made accessible for usage by a client or other web-based programs through an application
service provider’s web server. Web services allow information to be exchanged across web-
based applications. Using Utility Computing, web services can be provided.
5. World Wide Web: The internet is a vast network of interconnected computers. Using this
network, you can connect to the world wide web (abbreviated as ‘www’ or ‘web’) is a
collection of web pages. The web browser lets you access the web via the internet.
6. Directory Services: A directory service is a set of software that keeps track of information
about your company, customers, or both. Network resource names are mapped to network
addresses by directory services. A directory service provides users and administrators with full
transparent access to printers, servers, and other network devices. The directory services are :
 DNS (Domain Number System): This server provides DNS. The mappings of
computer hostnames and other types of domain names to IP addresses are stored on
a DNS server.
 LDAP (Lightweight Directory Access Protocol): It is a set of open protocols that
are used for obtaining network access to stored data centrally. It is a cross-platform
authentication protocol for directory services and also allows users to interact with
other directory services servers.
7. Automatic Network Address Configuration: Automatic Network Addressing assigns a
unique IP address to every system in a network. A DHCP Server is a network server that is
used to assign IP addresses, gateways, and other network information to client devices. It uses
Dynamic Host Configuration Protocol as a common protocol to reply to broadcast inquiries
from clients.
8. Network Management Services: Network management services are another essential
internet service that is beneficial to network administrators. Network management services aid
in the prevention, analysis, diagnosis, and resolution of connection problems. The two
commands related to this are:
 ping: The ping command is a Command Prompt command that is used to see if a
source can communicate with a specific destination & get all the possible paths
between them.
 traceroute: To find the path between two connections, use the traceroute command.
9. Time Services: Using facilities included in the operating system, you may set your
computer clock via the Internet. Some services are :
 Network Time Protocol (NTP): It is a widely used internet time service that
allows you to accurately synchronize and adjust your computer clock.
 The Simple Network Time Protocol (SNTP): It is a time-keeping protocol that is
used to synchronize network hardware. When a full implementation of NTP is not
required, then this simplified form of NTP is typically utilized.
10. Usenet: The ‘User’s Network’ is also known as Usenet. It is a network of online discussion
groups. It’s one of the first networks where users may upload files to news servers and others
can view them.
11. News Group: It is a lively Online Discussion Forum that is easily accessible via Usenet.
Each newsgroup contains conversations on a certain topic, as indicated by the newsgroup
name. Users can use newsreader software to browse and follow the newsgroup as well as
comment on the posts. A newsgroup is a debate about a certain topic made up of notes posted
to a central Internet site and distributed over Usenet, a global network of news discussion
groups. It uses Network News Transfer Protocol (NNTP).
12. E-commerce: Electronic commerce, also known as e-commerce or e-Commerce, is a
business concept that allows businesses and individuals to buy and sell goods through
the internet. Example: Amazon, Flipkart, etc. websites/apps.
Topic 7: Introduction to client-server computing

In client server computing, the clients requests a resource and the server provides that resource.
A server may serve multiple clients at the same time while a client is in contact with only one
server. Both the client and server usually communicate via a computer network but sometimes
they may reside in the same system.

An illustration of the client server system is given as follows −

Characteristics of Client Server Computing

The salient points for client server computing are as follows:

 The client server computing works with a system of request and response. The client
sends a request to the server and the server responds with the desired information.
 The client and server should follow a common communication protocol so they can
easily interact with each other. All the communication protocols are available at the
application layer.
 A server can only accommodate a limited number of client requests at a time. So it uses a
system based to priority to respond to the requests.
 Denial of Service attacks hindera servers ability to respond to authentic client requests by
inundating it with false requests.
 An example of a client server computing system is a web server. It returns the web pages
to the clients that requested them.

Core Java

Introduction: FEATURES OF JAVA


1. Simple: A very simple, easy to learn and understand language for programmers who are already
familiar with OOP concepts. Java’s programming style and structure follows the lineage of C, C++ and
other similar languages makes the use of java efficiently.

2. Object-oriented: Java is object oriented. Java inherits features of C++. OOP features of java are
influenced by C++. OOP concept forms the heart of java language that helps java program in survive the
inevitable changes accompanying software development.

3. Secure, Portable and Robust: Java programs are safe and secure to download from internet. At the
core of the problem is the fact that malicious code can cause its damage due to unauthorized access
gained to system resources. Java achieved this protection by confining a program to the Java execution
environment and not allowing it access to other parts of the computer. The same code must work on all
computers. Therefore, some means of generating portable executable code was needed. The multi-
platform environment of the Web places extraordinary demands on a program, because the program
must execute reliably in a variety of systems. Thus, the ability to create robust programs was given a
high priority in the design of Java. To gain reliability, Java restricts a few key areas and forces to find your
mistakes early in program development. At the same time, Java frees a programmer from having to
worry about many of the most common causes of programming errors.

4. Multithreaded: Java supports multithreaded programming, which allows a programmer to write


programs that performs multiple tasks simultaneously. The Java run-time system comes with an elegant
and sophisticated solution for multi-process synchronization that helps to construct smoothly running
interactive systems.

5. Architecture-neutral: Java was designed to support applications on networks composed of a variety


of systems with a variety of CPU and operating system architectures. With Java, the same version of the
application runs on all platforms. The Java compiler does this by generating bytecode instructions which
have nothing to do with particular processor architecture. Rather, they are designed to be both easy to
interpret on any machine and easily translated into native machine code on the fly.

6. Interpreted & High performance: Java enables the creation of cross-platform programs by compiling
into an intermediate representation called Java bytecode. This code can be executed on any system that
implements the Java Virtual Machine. Most previous attempts at crossplatform solutions have done so
at the expense of performance. The Java bytecode was carefully designed so that it would be easy to
translate directly into native machine code for very high performance by using a just-in-time compiler.
Java run-time systems that provide this feature lose none of the benefits of the platform-independent
code.

7. Distributed: Java is designed for the distributed environment of the Internet because it handles
TCP/IP protocols. In fact, accessing a resource using a URL is not much different from accessing a file.
Java also supports Remote Method Invocation (RMI). This feature enables a program to invoke methods
across a network.

8. Dynamic: Java programs carry with them substantial amounts of run-time type information that is
used to verify and resolve accesses to objects at run time. This makes it possible to dynamically link code
in a safe and expedient manner. This is crucial to the robustness of the Java environment, in which small
fragments of byte code may be dynamically updated on a running system.

JAVA PROGRAMMING FORMAT


Example: Swapping 2 numbers using Java code
public static void main(String[] args) {
int first = 12, second = 45;
System.out.println("--Before swap--");
System.out.println("First number = " + first);
System.out.println("Second number = " + second);
int temp = first; // Value of first is assigned to temporary
first = second; // Value of second is assigned to first
second = temp; // Value of temporary (which contains the initial value of first) is assigned
to second
System.out.println("--After swap--");
System.out.println("First number = " + first);
System.out.println("Second number = " + second);
}}
Output
--Before swap--
First number = 12
Second number = 45
--After swap--
First number = 45
Second number = 12

public static void main(String[] args)' is the entry point for any Java
program. It’s where the Java Virtual Machine (JVM) starts executing the program.

Here’s the breakdown:

1. public: This keyword means that the method is accessible anywhere,


including from outside the class it’s declared in.
2. static: By using ‘static’, we’re saying that the main method can be run
without needing an instance of the class.
3. void: This keyword indicates that the main method doesn’t return any
value.
4. main: ‘main’ is the name of this method. The JVM looks for a method
with this name when it starts running a program.
5. String[] args: This is an array of ‘String’ objects. It’s used to receive
any command-line arguments that were passed when the program was
started.
JAVA Tokens
JAVA Data Types

You might also like