Professional Documents
Culture Documents
Development
Image Source:
https://www.tutorialride.com/computer-network/world-wide-web-in-computer-netw
© Edunet Foundation. All rights reserved.
Learn basic concepts
regarding the
internet,browsers and
HTML.
HTTP
● Client-side storage
● Offline capabilities usage
● Data Entry support with HTML
● Game development usage
● Native APIs usage to enrich website
Image Source:
https://www.slideshare.net/manojkumardeswal/learn-html-manoj-kumar-deswal
© Edunet Foundation. All rights reserved.
Protocols
What is protocol?
Image Source:
https://www.net.t-labs.tu-berlin.de/teaching/computer_networking/01.02.htm
© Edunet Foundation. All rights reserved.
Protocols
Types of protocol
Types of protocol(contd)
HTML Forms
HTML Forms(contd)
HTML Forms(contd)
● <form> Element
● <input> Element
● The Action Attribute
● The Target Attribute
● The Method Attribute
● Text Fields
● password field
● checkbox
● radio button
● submit button
● reset button
● file select box
Image Source:
https://www.w3resource.com/html/input/HTML-input-tag-and-element.php
© Edunet Foundation. All rights reserved.
Forms and Input
● <input> Element
● <select> Element
● <textarea> Element
● <button> Element
● <fieldset> and <legend> Elements
● <datalist> Element
● <output> Element
Image Source:
https://deals.weku.io/community-deals/@munivihar/html-lessons-lesson-25
© Edunet Foundation. All rights reserved.
Forms and Input
What is Data?
What is a Database?
What is a Database?(contd)
DBMS
RDBMS
Image Source:
https://www.astera.com/type/blog/relational-database-management-system/
© Edunet Foundation. All rights reserved.
Database
RDBMS(contd)
Image Source:
https://www.researchgate.net/figure/Relational-database-data-model_fig1_316498
© Edunet Foundation. All rights reserved.
Database
● Number of operators
● Hardware and software needs
● Data modification
● Data volume
● Keys and Indexes
Image Source:
https://www.researchgate.net/figure/Relational-database-data-model_fig1_316498
© Edunet Foundation. All rights reserved.
Database
● Data consistency
● Database structure
● Data fetching speed
● Client server architecture
Image Source:
http://onlinetutorialhub.blogspot.com/2017/11/top-15-differences-between-dbms-a
© Edunet Foundation. All rights reserved.
Database
Types of Database
● Relational Database
● Object-Oriented Database
● Distributed Database
● NoSQL Database
● Graph Database
● Cloud Database
● Centralization Database
● Operational Database
● SSL
● Web page content
● Script Security
● Infrastructure
● The Data
● Tracking
● Archival and Backup
Image Source:
https://medium.com/koinex-crunch/enhancing-account-security-together-164fa8bf
© Edunet Foundation. All rights reserved.
APIs and Caching
HTML Geolocation
Image Source:https://www.w3schools.com/html/html5_geolocation.asp
© Edunet Foundation. All rights reserved.
HTML Geolocation
Location properties
HTML Drag/Drop
Image Source:https://www.w3schools.com/html/html5_draganddrop.asp
© Edunet Foundation. All rights reserved.
APIs and Caching
HTML Drag/Drop(contd)
Image Source:https://www.bitdegree.org/learn/html5-drag-and-drop
© Edunet Foundation. All rights reserved.
APIs and Caching
Image Source:https://www.w3schools.com/html/html5_webstorage.asp
© Edunet Foundation. All rights reserved.
HTML Web Storage
Image Source:https://www.w3schools.com/html/html5_webstorage.asp
© Edunet Foundation. All rights reserved.
HTML Web Storage
Image Source:https://www.w3schools.com/html/html5_webstorage.asp
© Edunet Foundation. All rights reserved.
APIs and Caching
Web Worker
Image Source:https://www.youtube.com/watch?v=AcIDmzPqlKA
© Edunet Foundation. All rights reserved.
Web Worker
Image Source:https://www.w3schools.com/html/html5_webworkers.asp
© Edunet Foundation. All rights reserved.
Web Worker
Image Source:https://www.w3schools.com/html/html5_webworkers.asp
© Edunet Foundation. All rights reserved.
Web Worker
Image Source:https://www.w3schools.com/html/html5_webworkers.asp
© Edunet Foundation. All rights reserved.
Web Worker
Image
Source:https://developers.google.com/web/fundamentals/primers/service-workers
© Edunet Foundation. All rights reserved.
APIs and Caching
Image Source:https://dzone.com/articles/html-5-server-sent-events
© Edunet Foundation. All rights reserved.
HTML SSE API
Image Source:https://www.w3schools.com/html/html5_serversentevents.asp
© Edunet Foundation. All rights reserved.
HTML SSE API
Image Source:https://www.w3schools.com/html/html5_serversentevents.asp
© Edunet Foundation. All rights reserved.
Structuring the web
● Introduction to HTML
● Structuring of Web Page using HTML
● Multimedia and embedding
● HTML Table and Forms
● APIs
What is an HTML?
● HTML stands for Hyper Text Markup
Language
● HTML is the standard markup language
for creating Web pages
● HTML describes the structure of a Web
page
● HTML consists of a series of elements
● HTML elements tell the browser how to
display the content
● The extension of HTML Page is .html
Image Source:
https://cdn.lynda.com/course/170427/170427-637251494437967118-16x9.jpg/
© Edunet Foundation. All rights reserved.
Introduction to HTML
Advantages of HTML
Image Source:
https://brandongaille.com/wp-content/uploads/2018/08/HTML5-Advantages-and-D
© Edunet Foundation. All rights reserved.
Introduction to HTML
Disadvantages of HTML
Image Source:
https://cdn.lynda.com/course/170427/170427-637251494437967118-16x9.jpg/
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
What is Multimedia?
Images in HTML
Images in HTML
● By default, a background-image is
placed at the top-left corner of an
element, and repeated both vertically
and horizontally.
Image Source: https://www.w3schools.com/cssref/pr_background-image.asp
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
● By default, a background-image is
placed at the top-left corner of an
element, and repeated both vertically
and horizontally.
Image Source: https://www.w3schools.com/cssref/pr_background-image.asp
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
Image Source:
https://www.w3schools.com/cssref/tryit.asp?filename=trycss_background-position
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
iframe in HTML
Image Source:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe_frameborder_
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
iframe in HTML
(Continued)
Image Source:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe_frameborder_
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
iframe in HTML
(Continued)
Image Source:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe_frameborder_
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
iframe in HTML
(Continued)
Image Source:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe_frameborder_
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
Embedding in HTML
Image Source:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_embed_video
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
Object in HTML
Image Source:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_object_video
© Edunet Foundation. All rights reserved.
Multi Media and Embedding
What is SVG?
Advantages of SVG
Tables in HTML
Image Source:
https://www.lorenzo-datasolutions.com/sap-successfactors-api-urls/
© Edunet Foundation. All rights reserved.
APIs
Image Source:
https://www.lorenzo-datasolutions.com/sap-successfactors-api-urls/
© Edunet Foundation. All rights reserved.
APIs
GeoLocation API
Image Source:
https://www.udemy.com/course/html5-geolocation-in-depth-build-location-aware-a
© Edunet Foundation. All rights reserved.
APIs
● getCurrentPosition()
● watchPosition()
● clearWatch()
Image Source:
https://www.udemy.com/course/html5-geolocation-in-depth-build-location-aware-a
© Edunet Foundation. All rights reserved.
APIs
Image Source:
https://www.techrepublic.com/blog/web-designer/learn-to-use-the-html5-drag-and-
© Edunet Foundation. All rights reserved.
APIs
● Drag
● Dragstart
● Dragenter
● Dragover
● Dragleave
● Drop
● Dragend
Web Storage
Image Source:
https://stackoverflow.com/questions/19867599/what-is-the-difference-between-loc
© Edunet Foundation. All rights reserved.
APIs
Web Worker
Image Source:
https://blog.sessionstack.com/how-javascript-works-the-building-blocks-of-web-wo
© Edunet Foundation. All rights reserved.
APIs
SSE
Image Source:https://prochazka.dev/server-sent-events/
© Edunet Foundation. All rights reserved.
APIs
● onopen
● Onmessage
● onerror
Image Source:https://prochazka.dev/server-sent-events/
© Edunet Foundation. All rights reserved.
Scripting and Styling the
web
● CSS Overview
● Syntax
● CSS values and units
● Stylingtext
● Stylingbox
● CSSlayout
What is CSS ?
Image Source:
https://justpublishingadvice.com/what-is-css-inline-css-tricks-and-tips-for-total-beg
© Edunet Foundation. All rights reserved.
CSS Overview
Why CSS ?
Image Source:
https://www.granneman.com/teaching/web-development-granneman-way/videos/
© Edunet Foundation. All rights reserved.
CSS Overview
Advantages of CSS
CSS id Selector
Types of CSS
Numerical Values
● Length values for specifying e.g.
element width, border thickness, or font
size.
● Pixels (px) are referred to as absolute
units because they will always be the
same size regardless of any other
related settings.
● em: 1em is the same as the font-size of
the current element (more specifically,
the width of a capital letter M.)
Image Source:
https://www.google.com/url?sa=i&url=https%3A%2F%2Fgetflywheel.com%2Flayo
© Edunet Foundation. All rights reserved.
CSS values and units
Numerical Values
● ex, ch: Respectively these are the height
of a lower case x, and the width of the
number 0. These are not as commonly
used or well-supported as ems.
● rem: The rem (root em) works in exactly
the same way as the em, except that it
will always equal the size of the default
base font-size
● vw, vh: Respectively these are 1/100th
of the width of the viewport, and 1/100th
of the height of the viewport.
Image Source:
https://www.google.com/url?sa=i&url=https%3A%2F%2Fgetflywheel.com%2Flayo
© Edunet Foundation. All rights reserved.
CSS values and units
Unitless Values
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
CSS values and units
Percentages
Image Source:
https://htmldog.com/references/css/values/percenta
© Edunet Foundation. All rights reserved.
Stylingtext
● The font-familyFonts
property is used to change the
face of a font.
● The font-style property is used to make a font
italic or oblique.
● The font-variant property is used to create a
small-caps effect.
● The font-weight property is used to increase or
decrease how bold or light a font appears.
● The font-size property is used to increase or
decrease the size of a font.
● The font property is used as shorthand to
specify a number of other font properties.
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Stylingtext
Color
● CSS uses color values to specify a color.
● Typically, these are used to set a color either
for the foreground of an element (i.e., its text)
or else for the background of the element.
● They can also be used to affect the color of
borders and other decorative effects.
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Stylingtext
Image Source:
https://www.google.com/imgres?imgurl=https%3A%2F%2Fiamvdo.me%2Fconten
© Edunet Foundation. All rights reserved.
Stylingtext
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Stylingbox
Box properties
● CSS box model is a container which contains
multiple properties including borders, margin,
padding and the content itself.
● It is used to create the design and layout of
web pages. It can be used as a toolkit for
customizing the layout of different elements.
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Stylingbox
● The overflow property specifies whether to clip
the contentOverflow
or to add scrollbars when the
content of an element is too big to fit in the
specified area.
● visible - Default. The overflow is not clipped.
The content renders outside the element's box
● hidden - The overflow is clipped, and the rest of
the content will be invisible
● scroll - The overflow is clipped, and a scrollbar
is added to see the rest of the content
● auto - Similar to scroll, but it adds scrollbars
only when necessary
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Stylingbox
● In CSS we broadly have two types of boxes —
block Box
boxesdisplay typesboxes. These
and inline
characteristics refer to how the box behaves in
terms of page flow, and in relation to other
boxes on the page:
● The box will break onto a new line.
● The box will extend in the inline direction to fill
the space available in its container. In most
cases this means that the box will become as
wide as its container, filling up 100% of the
space available.
●
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Styling box
Background color
● The background-color property in CSS is used
to specify the background color of an element.
● The background covers the total size of the
element with padding and border but excluding
margin.
● It makes the text so easy to read for the user.
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Styling box
Normal flow
Image Source:
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flow_Layout#:~:text=N
© Edunet Foundation. All rights reserved.
CSS layout
The
#geeks1{ display property
height: 100px;
width: 200px;
background: teal;
display: block;
● CSS FlexibleFlexbox
Box Layout, commonly known as
Flexbox, is a CSS3 web layout model.
● It is in the W3C's candidate recommendation
stage.
● The flex layout allows responsive elements
within a container to be automatically arranged
depending upon screen size.
display: flex;
background-color: DodgerBlue;
Flexbox
}
background-color: #f1f1f1;
margin: 10px;
padding: 20px;
font-size: 30px;
Image Source:
https://www.w3schools.com/css/tryit.asp?filename=trycss3_flexbox
© Edunet Foundation. All rights reserved.
CSS layout
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
CSS layout
Grid
Image Source:
https://www.w3schools.com/css/tryit.asp?filename=trycss_grid_layout_named
© Edunet Foundation. All rights reserved.
CSS layout
Floats
● The float CSS property places an element on
the left or right side of its container, allowing
text and inline elements to wrap around it.
● The element is removed from the normal flow
of the page, though still remaining a part of the
flow (in contrast to absolute positioning)
Image Source:
https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ah
© Edunet Foundation. All rights reserved.
Enhancing the web using
PHP
In this section, we will discuss:
Image Source:
https://www.techopedia.com/2/28997/development/web-development/php-101
PHP Fundamentals
Overview
Use of start and end tag
● Multiline comment:
− String, Integer
− Float, Boolean
− Array, Object
− NULL,Resource
Image Source: https://www.tutorialandexample.com/php-data-types/
PHP Forms, files and
cookies
PHP Forms
− GET and
− POST
● These methods are used in form tag as:
<form method=”GET”> and
● <form method=”POST”> Image Source: http://www.learncomputer.com/php-form-handling/
PHP Forms, files and
cookies
Steps in form handling
● Form display
− Close file
− HTTP
− FTP
− Standard I/O
● Enctype
● Action
● Method
● Input type
● Input name
PHP Forms, files and
cookies
Writing text file using PHP
Introduction
systems.
Introduction to PHPScript
acted upon.
Introduction to PHPScript
Features of PHP5
● In built functions
● Date and time functions
● String functions
● User defined functions
Working with Predefined
functions
Variable Scope
● strlen()
● substr()
● strtoupper() and strtolower()
● strpos()
Maintaining Validations in
PHP Script
PHP Variables
● $GLOBALS
● $_SERVER
● $_REQUEST
● $_POST
● $_GET
● $_FILES
● $_ENV
● $_COOKIE
● $_SESSION
Image Source:
https://codelack.com/wp-content/uploads/2017/05/Php_variable-e1496174087403
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
● <?php
$x = 75;
$y = 25;
function addition() {
$GLOBALS['z'] = $GLOBALS['x']
+ $GLOBALS['y'];
}
addition();
echo $z;
?> Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Element/Code Description
$_SERVER['GATEWAY_INTERFAC Returns the version of the Common Gateway Interface (CGI) the server is
E'] using
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
<!DOCTYPE html><html><body><?php
echo $_SERVER['PHP_SELF'];
echo "<br>";
echo $_SERVER['SERVER_NAME'];
echo "<br>";
echo $_SERVER['HTTP_HOST'];
echo "<br>";
echo "<br>";
echo $_SERVER['HTTP_USER_AGENT'];
echo "<br>";
echo $_SERVER['SCRIPT_NAME'];
Image Source:
?> © Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Example
<html> <body>
<form method="post" action="<?php echo
$_SERVER['PHP_SELF'];?>">
Name: <input type="text" name="fname">
<input type="submit">
</form>
<?php
Example
if ($_SERVER["REQUEST_METHOD"] ==
"POST") {
// collect value of input field
$name = $_REQUEST['fname'];
if (empty($name)) {
echo "Name is empty";
} else {
echo $name;
}}?></body></html>
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
● <html> <body>
<form method="post" action="<?php ech
o $_SERVER['PHP_SELF'];?>">
<?php
function validate($str) {
return trim(htmlspecialchars($str));
} // calling validate function
echo '<pre>';
echo validate(' <script> ');
echo '</pre>';
?>
We use in-built
function filter_var() with FILTER_VALIDATE
_EMAIL flag to validate emails.
The filter_var() can be used for many
purposes. To say that we are using it to
validate an email, we have to set the second
parameter (called as flag)
to FILTER_VALIDATE_EMAIL.
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
$email = validate($_POST['email’]);
if (!filter_var($email,
FILTER_VALIDATE_EMAIL)) { $emailError =
'Invalid Email'; }
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
URL Validation
$website = validate($_POST['website']);
if (!filter_var($website,
FILTER_VALIDATE_URL))
{
$websiteError = 'Invalid URL’;
}
The only validation should be done to
description input is, sending the input though Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2020/01/PHP-Superglobal-
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
<?php
$url = "https://www.w3schools.com";
if (filter_var($url, FILTER_VALIDATE_URL))
{
echo("$url is a valid URL");
} else {
echo("$url is not a valid URL");
}
?>
© Edunet Foundation. All rights reserved.
Maintaining Validations in
PHP Script
Checkbox Validation
Most of browsers set value of check box to
"on" if it is checked. We
use filter_var() function
with FILTER_VALIDATE_BOOLEAN flag to
convert it to boolean. This function will
convert "on" to true, which makes later
processes easy for us.
$remember =
validate($_POST['remember']);
$remember = filter_var($remember,
https://html.form.guide/assets/img/sample-cake-form-prev.3ddee477.png
FILTER_VALIDATE_BOOLEAN); © Edunet Foundation. All rights reserved.
Working with Different types
of Mouse Events
Event Description
Checkbox Validation
onclick The event occurs when the user clicks on an element
oncontextmenu The event occurs when the user right-clicks on an element to open a context
menu
onmousedown The event occurs when the user presses a mouse button over an element
onmouseenter The event occurs when the pointer is moved onto an element
onmousemove The event occurs when the pointer is moving while it is over an element
onmouseout The event occurs when a user moves the mouse pointer out of an element,
or out of one of its children
onmouseover The event occurs when the pointer is moved onto an element, or onto one of
its children
onmouseup The event occurs when a user releases a mouse button over an element
Onclick Event
<button onclick="getElementById('demo').in
nerHTML = Date()">What is the
time?</button>
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2019/11/event-attributes.pn
© Edunet Foundation. All rights reserved.
Working with Different types
of Mouse Events
Onclick Event
Onclick Event
<script>
function myFunction() {
document.getElementById("demo").innerHT
ML = "Hello World";
}
</script></body></html>
Ondblclick Event
Syntax :
<element ondblclick="myScript">
<html><body>
<p>This example demonstrates how to
assign an "ondblclick" event to a p
element.</p>
<p id="demo"
ondblclick="myFunction()">Double-click
me.</p> © Edunet Foundation. All rights reserved.
Working with Different types
of Mouse Events
Ondblclick Event
<script>
function myFunction() {
document.getElementById("demo").innerHT
ML = "I was double-clicked!";
}
</script></body></html>
Image Source:
https://di3xp7dfi3cq.cloudfront.net/pub/media/magefan_blog/10-applications-of-ob
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is Object-Oriented
Programming?
Image Source:
https://di3xp7dfi3cq.cloudfront.net/pub/media/magefan_blog/10-applications-of-ob
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is a Class?
Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is a Class?
Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is an Object?
Image Source:
https://lh3.googleusercontent.com/proxy/KhmzJ5_D0HmPEB_H625AXKySsn3IX6
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is an Object?
Image Source:
https://lh3.googleusercontent.com/proxy/KhmzJ5_D0HmPEB_H625AXKySsn3IX6
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is an Property?
Image Source:
https://image.slidesharecdn.com/introductiontoobjectorientedprogramming-14121
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is an Property?
Image Source:
https://image.slidesharecdn.com/introductiontoobjectorientedprogramming-14121
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
What is an Method?
Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Declaring Class
Naming a Class
Image Source:
https://todaypoints.azurewebsites.net/wp-content/uploads/2016/04/oopConcept-I
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
<?php
class House
{
public $primaryColor = 'black’;
public $secondaryColors = [ 'bathroom' =>
'white', 'bedroom' => 'light pink', 'kitchen' =>
'light blue' ];
public $hasPool = false;
public $extra;
} Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
<?php
class Example
{
public function echo($string)
{
echo $string;
}
}
We use the public keyword to make the
method available inside and outside the
Image Source:
class. https://javatutorial.net/wp-content/uploads/2014/11/class-object-featured-image.p
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
$this Keyword
$this Keyword
● Inside the class (by adding a set_name()
method and use $this):
<?php
class Fruit {
public $name;
function set_name($name) {
$this->name = $name;
}
}
$apple = new Fruit();
$apple->set_name("Apple");
Image Source:
echo $apple->name; © Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
new Keyword
Creating an instance
● <?php
$instance = new SimpleClass();
Object Assignment
<?php
$instance = new SimpleClass();
$assigned = $instance;
$reference =& $instance;
$instance->var = '$assigned will have this va
lue';
$instance = null; // $instance and $reference
become null
var_dump($instance);
var_dump($reference);
var_dump($assigned); Image Source:
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Object Assignment
<?php
class Test
{
static public function getNew()
{
return new static;
}
}
Object Assignment
$obj3 = Test::getNew();
var_dump($obj3 instanceof Test);
$obj4 = Child::getNew();
var_dump($obj4 instanceof Child);
?> Image Source:
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Constructors
<?php
class House {
public $name;
public $color;
public function __construct($name,
$color) {
$this -> name = $name;
$this -> color = $color;
}
Image Source:
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Constructors
Image Source:
https://tutorials.supunkavinda.blog/static/images/php-oop-visibility.jpg
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Types of Visibility
Image Source:
https://2.bp.blogspot.com/-BENn14np4qA/USjZDNwoaXI/AAAAAAAAAIE/a7gReK
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://2.bp.blogspot.com/-BENn14np4qA/USjZDNwoaXI/AAAAAAAAAIE/a7gReK
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
class Example {
public $property = 'property'; // a public
property public function myMethod()
{ // a public method echo 'Hello'; } }
Image Source:
https://tutorials.supunkavinda.blog/static/images/php-oop-visibility.jpg
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://2.bp.blogspot.com/-BENn14np4qA/USjZDNwoaXI/AAAAAAAAAIE/a7gReK
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
class Example {
private $property = 'property’;
// a private property
private function privateMethod()
{
// a private method
echo $this -> property;
// this is valid } }
class Example {
protected $property = 'This is a protected
property’;
protected function myMethod()
{
// I'm protected!
}
} Image Source:
https://2.bp.blogspot.com/-BENn14np4qA/USjZDNwoaXI/AAAAAAAAAIE/a7gReK
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
<?php
class User {
public $name = 'Hyvor';
public function changeName($name) {
$this -> name = $name;
}
}
Image Source:
https://tutorials.supunkavinda.blog/static/images/php-oop-visibility.jpg
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● Declaring Interfaces
Interfaces are declared using
the Interface keyword.
<?php
Interface MyFirstInterface
{
// Defining methods
}
Image
?> Sourcehttps://phpenthusiast.com/theme/assets/images/blog/factory_design_patte
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● Declaring Interfaces
Interfaces are declared using
the Interface keyword.
<?php
Class Car_model implements
MyFirstInterface
{
// Defining methods body
}
Image
?> Sourcehttps://phpenthusiast.com/theme/assets/images/blog/factory_design_patte
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
interface b extends a
{
public function baz(Baz $baz);
Image
} Sourcehttps://phpenthusiast.com/theme/assets/images/blog/factory_design_patte
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● Syntax:
● class Tom extends Person {...} is the
syntax for the child class.
Image Source:
https://tutorials.supunkavinda.blog/static/images/php-oop-inheritance-2.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Class Animal
{ // variables and methods
}
Class Dog extends Animal
{// variables and methods
}
Class Cat extends Animal
{// variables and methods
}
Image Source:
https://tutorials.supunkavinda.blog/static/images/php-oop-inheritance-2.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://1.bp.blogspot.com/-3WnKibey_3w/WWGroOYi5nI/AAAAAAAACCA/HA82Y
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Declare Abstract Classes and
Methods
Image Source:
https://1.bp.blogspot.com/-3WnKibey_3w/WWGroOYi5nI/AAAAAAAACCA/HA82Y
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://1.bp.blogspot.com/-3WnKibey_3w/WWGroOYi5nI/AAAAAAAACCA/HA82Y
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Abstraction Rules
Image Source:
https://online.visual-paradigm.com/images/tutorials/class-diagram-tutorial/08-abstr
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Abstraction Rules
Image Source:
https://online.visual-paradigm.com/images/tutorials/class-diagram-tutorial/08-abstr
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Abstraction Rules
Image Source:
https://online.visual-paradigm.com/images/tutorials/class-diagram-tutorial/08-abstr
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Abstraction Rules
Image Source:
https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/03/example-of-a
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
// Common method
public function printOut()
{
print $this->getValue() . "\n"; Image Source:
https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/03/example-of-a
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://tutorials.supunkavinda.blog/static/images/php-oop-abstract.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Implements Keyword
Image Source:
https://tutorials.supunkavinda.blog/static/images/php-oop-abstract.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Implements Keyword
Image Source:
https://miro.medium.com/max/596/1*SoyFBd8-AKktEDGou3C0kg.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Implements Keyword
Image Source:
https://miro.medium.com/max/596/1*SoyFBd8-AKktEDGou3C0kg.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
Image Source:
https://miro.medium.com/max/596/1*SoyFBd8-AKktEDGou3C0kg.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● Syntax
● <?php
trait TraitName {
// some code...
}
?>
Use
● <?php
class MyClass {
use TraitName;
} Image Source:
https://miro.medium.com/max/596/1*SoyFBd8-AKktEDGou3C0kg.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● <?php
trait message1 {
public function msg1() {
echo "OOP is fun! ";
}
}
class Welcome {
use message1;
}
$obj = new Welcome();
$obj->msg1(); Image Source:
https://miro.medium.com/max/596/1*SoyFBd8-AKktEDGou3C0kg.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
PHP - Constants
Image Source:https://clevertechie.com/img/main/php-constant.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
PHP - Constants
Image Source:https://clevertechie.com/img/main/php-constant.png
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● <?php
class Goodbye {
const LEAVING_MESSAGE = "Thank
you for visiting W3Schools.com!";
public function byebye() {
echo self::LEAVING_MESSAGE;
}
}
● Syntax:
● <?php
class ClassName {
public static function staticMethod() {
echo "Hello World!";
}
}
?>
● ClassName::staticMethod();
Image Source:
https://i1.wp.com/www.thecodingtutorials.com/wp-content/uploads/2020/03/static-
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● <?php
class greeting {
public static function welcome() {
echo "Hello World!";
}
}
Image Source:
https://i1.wp.com/www.thecodingtutorials.com/wp-content/uploads/2020/03/static-
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
● Syntax:
● <?php
class ClassName {
public static $staticProp
= "W3Schools";
}
?>
● To access a static property use the class
name, double colon (::), and the
property name:
Image Source:
● ClassName::staticProp; https://i1.wp.com/www.thecodingtutorials.com/wp-content/uploads/2020/03/static-
© Edunet Foundation. All rights reserved.
Object Oriented
Programming and PHP5
<html>
<body>
<?php
class pi {
public static $value = 3.14159;
}
// Get static property
echo pi::$value;
?>
</body>
</html> © Edunet Foundation. All rights reserved.
Debugging PHP Code
Definition
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Use
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Dumping Variables
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Dumping Variables
Example
<?php
$myVar = "hello world!";
var_dump($myVar);
print_r($myVar);
$allVars = get_defined_vars();
print_r($allVars);
debug_zval_dump($allVars);
function sayHello($hello) {
echo $hello;
debug_print_backtrace();
Image Source:
} https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
Debugging PHP Code
Image Source:
https://stackify.com/wp-content/uploads/2019/01/word-image-10.png
© Edunet Foundation. All rights reserved.
PHP Session Handling
Features
PHP Sessions
PHP Sessions
PHP Sessions
PHP Sessions
<?php
// Start the session
session_start();
?>
<html>
<body>
<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set."; Image source: https://www.sitesbay.com/php/images/session-in-php.png
© Edunet Foundation. All rights reserved.
PHP Session Handling
Features
<?php
session_start();
?>
<html>
<body>
<?php
// to change a session variable, just overwrite
it
$_SESSION["favcolor"] = "yellow";
print_r($_SESSION);
?> Image source: https://www.sitesbay.com/php/images/session-in-php.png
© Edunet Foundation. All rights reserved.
PHP Session Handling
Features
<?php
session_start();
?>
<html><body><?php
// remove all session variables
session_unset();
XAMPP Installation
● https://youtu.be/h6DEDm7C37A
● Step 1:
sudo tasksel install lamp-server
● Step 2:
sudo apt install phpMyAdmin
● Step 3: Configuration
To use phpMyAdmin to administer a MySQL
database hosted on another server, adjust the
following in /etc/phpmyadmin/config.inc.php:
$cfg['Servers'][$i]['host'] =
'db_server';$cfg['Servers'][$i]['host'] =
Image source: https://www.sitesbay.com/php/images/session-in-php.png
'db_server'; © Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
Introduction
https://www.plus2net.com/php_tutorial/images/date-time.jpg
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
Introduction (Continue)
https://www.tutorialspoint.com/php/php_date_and_time.htm
© Edunet Foundation. All rights reserved.
Handling Date & Time in Key & Description
PHP seconds Seconds past the minutes (0-59)
minutes Minutes past the hour (0 - 59)
hours Hours of the day (0 - 23)
Introduction (Continue) mday Day of the month (1 - 31)
https://www.tutorialspoint.com/php/php_date_and_time.htm
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
Introduction (Continue)
https://www.tutorialspoint.com/php/php_date_and_time.htm
© Edunet Foundation. All rights reserved.
Format & Description
Handling Date & Time in a 'am' or 'pm' lowercase
A 'AM' or 'PM' uppercase
PHP d Day of month, a number with leading zeroes
D Day of week (three letters)
Introduction (Continue) F Month name
h Hour (12-hour format - leading zeroes)
H Hour (24-hour format - leading zeroes)
g Hour (12-hour format - no leading zeroes)
G Hour (24-hour format - no leading zeroes)
● The date() optionally accepts a time stamp i Minutes ( 0 - 59 )
if omitted then current date and time will L Leap year ('1' for yes, '0' for no)
be used. m Month of year (number - leading zeroes)
● Any other data you include in the format M Month of year (three letters)
string passed to date() will be included in s Seconds of hour
the return value. y Year (two digits)
Y Year (four digits)
z Day of year (0 - 365)
https://www.tutorialspoint.com/php/php_date_and_time.htm
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
Installation
https://cdn.lynda.com/course/188214/188214-636673517617174317-16x9.jpg
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
Runtime Configuration
https://www.w3schools.com/php/php_ref_date.asp
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
● checkdate()
https://errorsea.com/wp-content/uploads/2019/11/php-Date-Time-functions.png
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
PHP Date & Time Functions
(Continue)
● date_create_from_format()
● date_date_set()
https://errorsea.com/wp-content/uploads/2019/11/php-Date-Time-functions.png
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
PHP Date & Time Functions
(Continue)
● date_diff()
● date_sub()
● date_sunrise()
● date_timezone_get()
● gmmktime()
● timezone_location_get()
https://errorsea.com/wp-content/uploads/2019/11/php-Date-Time-functions.png
© Edunet Foundation. All rights reserved.
Handling Date & Time in
PHP
https://www.edureka.co/blog/wp-content/uploads/2019/07/DATE-FORMAT-IN-JA
© Edunet Foundation. All rights reserved. VA.jpg
Handling Date & Time in
PHP
PHP Date & Time Constants
(Continue)
https://www.edureka.co/blog/wp-content/uploads/2019/07/DATE-FORMAT-IN-JA
© Edunet Foundation. All rights reserved. VA.jpg
Handling Date & Time in
PHP
PHP Date & Time Constants
(Continue)
https://www.edureka.co/blog/wp-content/uploads/2019/07/DATE-FORMAT-IN-JA
© Edunet Foundation. All rights reserved. VA.jpg
Handling Date & Time in
PHP
PHP Date & Time Constants
(Continue)
● SUNFUNCS_RET_TIMESTAMP:
Timestamp (since PHP 5.1.2)
● SUNFUNCS_RET_STRING:
Hours:minutes (example: 09:41) (since
PHP 5.1.2)
● SUNFUNCS_RET_DOUBLE: Hours as
a floating point number (example: 9.75)
(since PHP 5.1.2)
https://www.edureka.co/blog/wp-content/uploads/2019/07/DATE-FORMAT-IN-JA
© Edunet Foundation. All rights reserved. VA.jpg
Handling Date & Time in
PHP
PHP Date & Time Constants
(Continue)
● DATE_RFC3339_EXTENDED:
RFC3339 Extended format (since PHP
7.0.0) (example:
2019-01-18T16:34:01.000+00:00)
● DATE_RSS: RSS (Fri, 18 Jan 2019
14:13:03 +0000)
● DATE_W3C: World Wide Web
Consortium (example:
2019-01-18T14:13:03+00:00)
https://www.edureka.co/blog/wp-content/uploads/2019/07/DATE-FORMAT-IN-JA
© Edunet Foundation. All rights reserved. VA.jpg
Installing and Managing
MySQL
Concept of Database
https://cdn.lynda.com/course/548706/548706-637199619492944531-16x9.jpg
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
https://www.computerhope.com/jargon/d/database.jpg
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
https://www.guru99.com/images/1/091318_0814_DBMSSchemas1.png
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Relational_database
© Edunet Foundation. All rights reserved. _terms.svg/1200px-Relational_database_terms.svg.png
Installing and Managing
MySQL
https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Relational_database
© Edunet Foundation. All rights reserved. _terms.svg/1200px-Relational_database_terms.svg.png
Installing and Managing
MySQL
https://www1.udel.edu/evelyn/SQL-Class2/joins.jpg
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTj7eO4_1pbqHbuM
© Edunet Foundation. All rights reserved. wl5Z7kgQYv4uzY0r-Vu0Dpm-WrRdk_Ht-BK&usqp=CAU
Installing and Managing
MySQL
Introduction to MYSQL
https://upload.wikimedia.org/wikipedia/en/thumb/6/62/MySQL.svg/1200px-MySQL
© Edunet Foundation. All rights reserved. .svg.png
Installing and Managing
MySQL
https://img-a.udemycdn.com/course/750x422/2390114_404d_3.jpg
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
MYSQL Characteristics:
1. Very fast and consistent performance
2. Highly reliable
3. Easy to use
4. Freely available (Open source)
5. Can run on various platforms like Linux,
Windows, HP-UX
https://www.edureka.co/blog/wp-content/uploads/2018/10/Features-of-sql.png
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
6. Scalability
7. Robust
8. Web data strength
9. Data security
10. Comprehensive application
development
https://www.edureka.co/blog/wp-content/uploads/2018/10/Features-of-sql.png
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
MYSQL Statements
Replication Statements
● These statements are used to control
master or slave servers.
Prepared Statements
● Prepared statements are the queries
those are compiled once on the server
level and parameters are then passed to
the server instead of building the query
each.
Utility Statements
● These statements are used for getting
help from database system for any type
of statements or functionality
commands.
Stored Procedures
https://www.mysqltutorial.org/getting-started-with-mysql-stored-procedures.aspx
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
Advantages:
1. Reduce network traffic
2. Centralize business logic in the
database
3. Make database more secure
https://www.mysqltutorial.org/getting-started-with-mysql-stored-procedures.aspx
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
Disadvantages:
1. Resource usages
2. Troubleshooting
3. Maintenances
https://www.mysqltutorial.org/getting-started-with-mysql-stored-procedures.aspx
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
https://lh3.googleusercontent.com/proxy/i7MZIhpc1gQf5wNrY66fr9tyCySgry1dVkI
-hiz1AKBdEpkVQrjWwPpYeOypTM8MboWEmiWsvFNmYY8eqKYweaeISXPpjA
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
https://udemy-images.udemy.com/course/750x422/155640_6f5f_3.jpg
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
Connecting to Database
https://www.tutorialspoint.com/php/connect_to_mysql_using_php.htm
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
https://www.tutorialspoint.com/php/connect_to_mysql_using_php.htm
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
Creating MYSQL Database Using
PHP
● Syntax:
bool mysql_query( sql, connection );
● Sql
https://www.tutorialspoint.com/php/create_mysql_database_using_php.htm
© Edunet Foundation. All rights reserved.
Installing and Managing
MySQL
Fetching Data
https://www.tutorialspoint.com/php/mysql_select_php.htm
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Introduction
https://cdn.freshdesignweb.com/wp-content/uploads/site/mysql-interface.jpg
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Introduction (Continue)
https://miro.medium.com/max/904/1*--XmrOJdNZE_u8lNTxZzoA.png
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Introduction (Continue)
https://en.wikipedia.org/wiki/PhpMyAdmin
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
phpMyAdmin
phpMyAdmin (Continue)
Features
● Intuitive web interface
● Support for most MySQL features
● Import data from CSV and SQL
● Export data to various formats
● Administering multiple servers
● Creating complex queries using
Query-by-example (QBE)
https://i0.wp.com/fossnaija.com/wp-content/uploads/2017/08/phpmyadmin.png?ss
© Edunet Foundation. All rights reserved. l=1
Understanding and Using
MySQL Clients
phpMyAdmin (Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Understanding and Using
MySQL Clients
Management Console Overview
(Continue)
https://www.siteground.com/tutorials/phpmyadmin/administration/
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
Design Patterns
https://www.script-tutorials.com/design-patterns-in-php/
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
Design Patterns (Continue)
https://www.script-tutorials.com/design-patterns-in-php/
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
Design Patterns (Continue)
https://www.script-tutorials.com/design-patterns-in-php/
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
Design Patterns (Continue)
https://www.script-tutorials.com/design-patterns-in-php/
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
PHP Mail Functions
https://www.w3schools.com/php/php_ref_mail.asp
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
PHP Mail Functions (Continue)
● Syntax
mail(to,subject,message,headers,parameter
s);
https://www.w3schools.com/php/func_mail_mail.asp
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
PHP Mail Functions (Continue)
Parameter Description
Parameter Description
Parameter Description
https://1.bp.blogspot.com/-56yMnwfCrPc/XEgzu66f2-I/AAAAAAAAzGw/PIVukGD
XCsg140XiLwj8GYAkG5Lv7p_2wCLcBGAs/s728-e100/php-pear-hacked-packag
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
PEAR & cURL (Continue)
https://lh3.googleusercontent.com/proxy/pUwJ27RT_Il90DZwQqMz49GezSmBwk
bRmX9oaQgjXwE0NdDW0vDwoGMg1XBiYIN0ZxDIrrYjWat8gJIv4sMjUwSW-P6b
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
PEAR & cURL (Continue)
https://curl.haxx.se/logo/curl-logo.svg
© Edunet Foundation. All rights reserved.
Database Access, Design
Patterns, Mail Function,
PEAR and cURL
PEAR & cURL (Continue)
https://www.geeksforgeeks.org/php-curl/
© Edunet Foundation. All rights reserved.
JAVA: The key language.
What is JAVA
● A general-purpose object-oriented
language.
● Write Once Run Anywhere (WORA).
● Designed for easy Web/Internet
applications.
● Widespread acceptance.
Image Source:
https://www.edureka.co/blog/wp-content/uploads/2018/01/what-is-java-000.png
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
What is JAVA
Image Source:
https://www.edureka.co/blog/wp-content/uploads/2018/01/what-is-java-000.png
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
History of JAVA
History of JAVA
History of JAVA
Image Source:
https://cdn.lynda.com/video/560731-42-636149676558616265_338x600_thumb.jp
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
JAVA Editions
Image Source:
https://quiz.tcalive.in/wp-content/uploads/2018/09/Picture1-460x282.jpg
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Image
Source:https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/04/Differe
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/04/Difference-bet
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Applications of JAVA
Image Source:
https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/01/applications-o
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Applications of JAVA
Image Source:
https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/01/applications-o
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
JAVA Environment
Image Source:
https://qph.fs.quoracdn.net/main-qimg-dcbbbb2f41e23c8f38f8b9632ff1189d.webp
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
JAVA Environment
Image
Source:https://qph.fs.quoracdn.net/main-qimg-dcbbbb2f41e23c8f38f8b9632ff1189
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Advantages of JAVA
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Object-Oriented
● All coding and data reside within object
and classes.
● Java has built-In exception handling.
● Everything in Java (except the primitive
data types) is an object.
● The object model in java is simple and
easy to extend so that complex
programming problems can be reduced
to simple solutions.
● Extensive set of classes, arranged in
packages e.g. java.awt, java.io, java.net
. Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Robust
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Secure
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Distributed
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Multithreaded
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Advantages of JAVA
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/06/Advantages-of-
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Image
Source:https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTBvqDboD
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Image
Source:https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTBvqDboD
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Image
Source:https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTBvqDboD
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
Image
Source:https://images.idgesg.net/images/article/2020/01/jw-whatisjre-fig1-100827
© Edunet Foundation. All rights reserved.
Introduction to Java
Programming
● Deployment Technologies –
Image
Source:https://images.idgesg.net/images/article/2020/01/jw-whatisjre-fig1-100827
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2019/11/Java-Virtual-Machi
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Image Source:
https://cdn.educba.com/academy/wp-content/uploads/2019/11/Java-Virtual-Machi
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Image
Source:https://cdn.educba.com/academy/wp-content/uploads/2019/11/Java-Virtua
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Components of JVM
Image Source:
https://d1jnx9ba8s6j9r.cloudfront.net/blog/wp-content/uploads/2019/07/JVM.png
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Image
Source:https://lh3.googleusercontent.com/proxy/YAOhV9KJEbR9vmTfZQPWcfTI-
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Class Loader
Image
Source:https://javatutorial.net/wp-content/uploads/2017/10/hierarchy-of-class-load
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Class Loader
Image
Source:https://javatutorial.net/wp-content/uploads/2017/10/hierarchy-of-class-load
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Execution Engine
Image
Source:https://www.javacodegeeks.com/wp-content/uploads/2018/04/jvm_archi_e
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Garbage Collector
Image
Source:https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/03/types-
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Security Manager
Image
Source:https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcT9k3xgLqw
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Comparison of JVM
Image Source:
https://image.slidesharecdn.com/java-120313105732-phpapp02/95/javajava-virtu
© Edunet Foundation. All rights reserved.
The Java Virtual Machine
Comparison of JVM
Image Source:
https://image.slidesharecdn.com/java-120313105732-phpapp02/95/javajava-virtu
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Variable
Image
Source:https://data-flair.training/blogs/wp-content/uploads/sites/2/2019/07/Types-
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Instance Variable
Class Variable
Image Source:https://i.ytimg.com/vi/3gYr83ni388/maxresdefault.jpg
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Class Variable
Image Source:https://i.ytimg.com/vi/3gYr83ni388/maxresdefault.jpg
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Local Variable
● A method stores its temporary state
in local variables. The syntax for
declaring a local variable is similar to
declaring a field (for example, int
count = 0;)
● There is no special keyword
designating a variable as local; that
determination comes entirely from
the location in which the variable is
declared—between the opening and
closing braces of a method. Image
Source:https://image.slidesharecdn.com/oopinjava-161127140542/95/type-of-vari
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Local Variable
Image
Source:https://image.slidesharecdn.com/oopinjava-161127140542/95/type-of-vari
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Parameter
Image
Source:https://image.slidesharecdn.com/methods-091116064834-phpapp02/95/m
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Datatype
Image Source:https://static.javatpoint.com/images/java-data-types.png
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Datatype
Image Source:https://static.javatpoint.com/images/java-data-types.png
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Primitive Datatype
Image
Source:https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/02/primiti
© Edunet Foundation. All rights reserved.
Variables and Datatypes
Primitive Datatype
● Byte
● Short
● Int
● Long
● Float
● Double
● Boolean
● char Image
Source:https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/02/primiti
© Edunet Foundation. All rights reserved.
Primitive Datatypes
Byte
Short
Integer
● Int data type is a 32-bit signed two's
complement integer.
● Minimum value is - 2,147,483,648
(-2^31)
● Maximum value is
2,147,483,647(inclusive) (2^31 -1)
● Integer is generally used as the default
data type for integral values unless there
is a concern about memory.
● The default value is 0
● Example: int a = 100000, int b = Image
-200000 Source:https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/02/primiti
© Edunet Foundation. All rights reserved.
Primitive Datatypes
Long
● Long data type is a 64-bit signed two's
complement integer
● Minimum value is
-9,223,372,036,854,775,808(-2^63)
● Maximum value is
9,223,372,036,854,775,807
(inclusive)(2^63 -1)
● This type is used when a wider range
than int is needed
● Default value is 0L
● Example: long a = 100000L, long b = Image
-200000L Source:https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/02/primiti
© Edunet Foundation. All rights reserved.
Primitive Datatypes
Float
Double
Boolean
Character
Reference/Object Datatype
Reference/Object Datatype
Image
Source:https://www.itcsolutions.eu/wp-content/uploads/2011/01/References3.gif
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Control Statements
● if statement
● nested if statement
● if-else statement
● if-else-if statement
Image Source:
https://simplesnippets.tech/wp-content/uploads/2018/03/control-statements-in-jav
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Statements
if(condition){
Statement(s);
}
Image
Source:https://media.geeksforgeeks.org/wp-content/uploads/20191118171408/If-
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Statements
Image
Source:https://beginnersbook.com/wp-content/uploads/2017/08/if_statement_flow
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Statements
Image
Source:https://beginnersbook.com/wp-content/uploads/2017/08/if_statement
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Else Statements
This is how an if-else statement looks:
if(condition) {
Statement(s);
else {
Statement(s);
}
Image Source:
https://beginnersbook.com/wp-content/uploads/2017/08/If_else_flow_diagram.jpg
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Else Statements
Image
Source:https://beginnersbook.com/wp-content/uploads/2017/08/If_else_flow_diag
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Else If Statements
Image Source:
https://i1.wp.com/coderforevers.com/wp-content/uploads/2018/10/Java-if-else-Lad
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Else If Statements
Syntax:-
if(condition_1) {
statement(s);
else if(condition_2) {
statement(s);
Image Source:
} https://i1.wp.com/coderforevers.com/wp-content/uploads/2018/10/Java-if-else-Lad
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Else If Statements
else if(condition_3) {
statement(s);
}
else {
statement(s);
}
Image Source:
https://i1.wp.com/coderforevers.com/wp-content/uploads/2018/10/Java-if-else-Lad
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
If Else If Statements
Image Source
https://i1.wp.com/coderforevers.com/wp-content/uploads/2018/10/Java-if-else-Lad
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Nested If Statements
Nested If Statements
Syntax:-
if(condition){
//code to be executed
if(condition){
//code to be executed
} Image Source:https://o7planning.org/en/11561/cache/images/i/12387382.png
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Nested If Statements
Syntax:-
if(condition){
//code to be executed
if(condition){
//code to be executed
} Image Source:https://o7planning.org/en/11561/cache/images/i/12387382.png
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
case constant:
case constant:
default:
;
}
Image Source:
https://beginnersbook.com/wp-content/uploads/2017/08/switch_case_flow_diagra
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
● For statement
● For-each statement
● While statement
● Do while statement
● Continue Statement
● Break Statement
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/01/Types-of-Loop
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
For Loop
Image Source:
https://beginnersbook.com/wp-content/uploads/2015/03/for_loop_Java.jpg
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
For Loop
Image Source:
https://beginnersbook.com/wp-content/uploads/2015/03/for_loop_Java.jpg
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
For Loop
Image
Source:https://beginnersbook.com/wp-content/uploads/2015/03/for_loop_Java.jpg
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Image Source:
https://i.pinimg.com/originals/50/5d/a5/505da552a8af7974e0417bec12d5ece7.pn
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Syntax:
Image Source:
https://i.pinimg.com/originals/50/5d/a5/505da552a8af7974e0417bec12d5ece7.pn
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
While Loop
Image Source:https://static.javatpoint.com/cpages/images/while.png
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
While Loop
Syntax:-
while(condition){
//code to be executed
Do While Loop
Do While Loop
Syntax:-
do{
//code to be executed
}while(condition);
Image Source:
https://beginnersbook.com/wp-content/uploads/2015/03/do-while_java.jpg
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Continue Statement
Continue Statement
Syntax:
jump-statement;
break;
Image Source:
https://d1jnx9ba8s6j9r.cloudfront.net/blog/wp-content/uploads/2019/09/Flowchart-
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Break Statement
Break Statement
Syntax:-
The syntax of a break is a single statement
inside any loop −
break;
Array
Array
Image
Source:https://cdn.educba.com/academy/wp-content/uploads/2019/11/Types-of-A
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Image
Source:https://media.geeksforgeeks.org/wp-content/cdn-uploads/Blank-Diagram-
© Edunet Foundation. All rights reserved.
Conditional and Looping
Constructs Arrays
Image Source:https://media.geeksforgeeks.org/wp-content/uploads/two-d.png
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Object-Oriented Programming
● Polymorphism
● Inheritance
● Encapsulation
● Abstraction
● Class
● Object
● Method
● Message Passing
Image Source:
https://i2.wp.com/francescolelli.info/wp-content/uploads/2019/08/java-oops.png?fit
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Polymorphism
Image Source:
https://cdn.programiz.com/sites/tutorial2program/files/java-working-inheritance.pn
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Inheritance
Syntax:
} Image Source:
https://cdn.programiz.com/sites/tutorial2program/files/java-working-inheritance.pn
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Encapsulation
Image Source:
https://1.bp.blogspot.com/-S_KNWGJx3sY/XY-rE_uKOuI/AAAAAAAASVE/EYr_f9
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Class
Image Source:
https://media.geeksforgeeks.org/wp-content/uploads/Blank-Diagram-Page-1-5.pn
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Object
Image Source:
https://media.geeksforgeeks.org/wp-content/uploads/methods-in-java.png
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Method
Image Source:
https://media.geeksforgeeks.org/wp-content/uploads/methods-in-java.png
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Message Passing
Image Source:
https://bparanj.gitbooks.io/ruby-basics/content/message-passing-diagram.png
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Classes and Objects in Java
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/01/Java-Class-an
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Define Class
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/01/Java-Class-an
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Class declaration can include these
components
● Modifiers
● Class name
● Superclass
● Interfaces
● Body
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/01/Java-Class-an
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Class declaration can include these
components
● Modifiers : A class can be public or has
default access (Refer this for details).
● Class name: The name should begin
with a initial letter (capitalized by
convention).
● Superclass(if any): The name of the
class’s parent (superclass), if any,
preceded by the keyword extends. A
class can only extend (subclass) one
parent.
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/01/Java-Class-an
© Edunet Foundation. All rights reserved.
Object-Oriented
Programming with Java
Classes and Objects
Class declaration can include these
components
Image Source:
https://data-flair.training/blogs/wp-content/uploads/sites/2/2018/01/Java-Class-an
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
What is Exception
● An exception is an “unwanted or
unexpected event”, which occurs during
the execution of the program i.e, at
run-time, that disrupts the normal flow of
the program’s instructions.
● When an exception occurs, execution of
the program gets terminated.
Image Source:
https://image.slidesharecdn.com/exceptionslohika-120709091145-phpapp01/95/e
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
Why does an Exception occur
Image Source:
https://image.slidesharecdn.com/exceptionslohika-120709091145-phpapp01/95/e
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs 1. statement 1;
Advantages of Exception handling 2. statement 2;
3. statement 3;
● Suppose there are 10 statements in 4. statement 4;
your program and there occurs an
5. statement 5;//exception occurs
exception at statement 5, the rest of the
code will not be executed i.e. statement 6. statement 6;
6 to 10 will not be executed. 7. statement 7;
● If we perform exception handling, the
8. statement 8;
rest of the statement will be executed.
● That is why we use exception handling 9. statement 9;
in Java. 10. statement 10;
Image Source:
https://simplesnippets.tech/wp-content/uploads/2018/05/java-exception-handling-c
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
Types of Java Exceptions
● Checked Exception
● Unchecked Exception
● Error
Image Source: https://static.javatpoint.com/images/types-of-java-exceptions.jpg
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
Difference between Checked and
Unchecked Exception
● Checked Exception
○ The classes which directly inherit
Throwable class except
RuntimeException and Error are
known as checked exceptions
○ e.g. IOException, SQLException
etc. Checked exceptions are
checked at compile-time.
Image Source:
https://1.bp.blogspot.com/-TPzCj5sOo7w/XlYI5WsMoaI/AAAAAAAADwI/lCxhZXJ
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
Difference between Checked and
Unchecked Exception
● Unchecked Exception
○ The classes which inherit
RuntimeException are known as
unchecked exceptions
○ e.g. ArithmeticException,
NullPointerException,
ArrayIndexOutOfBoundsException
etc.
○ Unchecked exceptions are not
checked at compile-time, but they Image Source:
are checked at runtime. https://1.bp.blogspot.com/-TPzCj5sOo7w/XlYI5WsMoaI/AAAAAAAADwI/lCxhZXJ
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
Java Exception Keywords
● Try
● Catch
● Throw
● Throws
● Finally
try
Image Source:
https://www.guru99.com/images/java/052016_0839_JavaExcepti6.jpg
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
Catch
Image Source:
https://www.guru99.com/images/java/052016_0839_JavaExcepti6.jpg
© Edunet Foundation. All rights reserved.
Exception handling with
try-throw-catch-finally
constructs
Throw
Image Source:
https://qph.fs.quoracdn.net/main-qimg-6196f606623fffd5c336485ed0c1318a.web
© Edunet Foundation. All rights reserved.
Working with types:
Wrapper Class
Introduction
Image Source :
© Edunet Foundation. All rights reserved. https://dkb46014en6d6.cloudfront.net/tutorials/wp-content/upl
Working with types:
Wrapper Class
Advantages
Image Source:
https://dkb46014en6d6.cloudfront.net/tutorials/wp-content/uploads/sites/2/2020/03/advantages-of-
wrapper-class-in-java.jpg
Conversion
Conversion
Autoboxing
Unboxing
Methods
Package in Java
Image Source:
https://dkb46014en6d6.cloudfront.net/tutorials/wp-content/uploads/sites/2/2020/03/Advantages-of
-java-packages.jpg
Types of Packages
Image Source:
https://dkb46014en6d6.cloudfront.net/tutorials/wp-content/uploads/sites/2/2020/03/types-of-packa
ges-in-java.jpg
Built-In Packages
Image Source:
https://dkb46014en6d6.cloudfront.net/tutorials/wp-content/uploads/sites/2/2020/03/Built-in-pack
ages-in-java.jpg
User-defined Package
User-defined Package
User-defined Package
User-defined Package
Accessing Packages or
Classes from Another Package
Accessing Packages or
Classes from Another Package
Introduction
Types of Applets
Types of Applets
Local Applet
Types of Applets
Remote Applet
Applet Program
Event Handling
Event Handling
Event Handling
Event Handling
AWT Hierarchy
Window Fundamentals
Image Source:
https://www.ntu.edu.sg/home/ehchua/programming/java/images/AWT_ContainerComponent.png
© Edunet Foundation. All rights reserved.
● Frame()
Basics of AWT and Swing ● Frame(String Title)
● Void setsize()
● Void show()
AWT ● Void setBackground(Color c)
● Void setLocation(int x,int y)
Image Source:
https://www.ntu.edu.sg/home/ehchua/programming/java/images/AWT_ContainerComponent.png
© Edunet Foundation. All rights reserved.
Basics of AWT and Swing
AWT
● Creating a Frame
● Setting Frame Properties
● Dimension getSize()
● Canvas
AWT Controls
Buttons
AWT Controls
Check boxes
AWT Controls
TextFields
AWT Controls
TextAreas
AWT Controls
Choice Class
AWT Controls
List Class
AWT Controls
Canvas
AWT Controls
AWT Controls
AWT Controls
AWT PopupMenu
AWT Controls
AWT Panel
AWT Controls
AWT Dialog
AWT Controls
AWT Toolkit
Layout Manger
Layout Manger
BorderLayout
java JFrame
Layout Manger
FlowLayout
Layout Manger
GridBagLayout
Swing
Swing Framework
● Swing Framework contains a set of
classes that provides more powerful and
flexible GUI components than those of
AWT.
● Swing provides the look and feel of
modern Java GUI.
● Swing classes are defined in
javax.swing package and its
sub-packages.
© Edunet Foundation. All rights reserved.
Basics of AWT and Swing
Swing
● Platform Independent
● Customizable
● Extensible
● Configurable
● Lightweight
● Rich Controls
● Pluggable Look and Feel
Swing
Swing
Features of JFC
Swing
Swing Hierarchy
Swing
Swing Classes
Swing
Creating a JFrame
Swing GUI
● Swing isWhat
a GUIis toolkit
Swingthat
GUI??
facilitates the
creation of highly interactive GUI
applications.
● Swing is more flexible and robust when
it comes to implementing graphical
components.
● Swing can be regarded as more
graphically-rich than AWT not only
because they provide some entirely new
graphical components like a tabbed
window and tree structure. © Edunet Foundation. All rights reserved.
Basics of AWT and Swing
Swing GUI
Key Items
○ Components
○ Containers
Swing GUI
Components
Swing GUI
Swing GUI
Swing Components - 2
Swing GUI
Container
Swing GUI
Swing GUI
Containers - Lightweight
Swing GUI
MultiThreading
Important Terminology
● New
● Runnable
● Running
● Waiting
● Terminated
Image Source : https://www.studytonight.com/java/images/thread-life-cycle.jpg
Achieve Multithreading
Achieve Multithreading
Achieve Multithreading
Runnable Interface
Achieve Multithreading
Extending Thread
Thread Priority
Interthread Communication
Thread Pooling
Thread Deadlock
Thread Synchronization
Advantages of Multithreading
Introduction
● IP Address
● Protocol
● MAC Address
● Port Number
Socket Overview
java.net
InetAddress
java.net
URL Class
java.net