Intership Report
Intership Report
On
JAVA FULL STACK
Submitted
CERTIFICATE
This is to certify that the Mr. / Ms. NAMBURI VENKATA SAIPRATHAP _
Introduction to CSS
CSS Basics
CSS Introduction
Styling Fonts
Styling Text
Introduction to JAVA
Why Java was developed?
History of JAVA
Different Java Platforms
JVM Architecture
Installing java on windows
JAVA Language Fundamentals
Identifiers
Keywords
Variables
Literals
Data Types
Operators
Looping Statements
Condition Statements
Type Casting
Comments
OOP implementation
Why OOP?
OOP concepts with Real life Examples
Class & Object
Reference variable
Constructors
Instance & static Variables & Methods
These Keyword & it’s usages
Inheritance & it’s Syntax
Types of Inheritance
Object Class as Root of java class hierarchy
Variable Hiding
Method Hiding
Method Overriding & Overloading
Super Keyword & it’s usages
Final Keyword & it’s usages
Constructor Chaining
Upcasting and Down casting
Static and Dynamic Binding
`
3
Run time Polymorphism
Abstract Keyword (Abstract classes and methods)
Understanding Interfaces
Implementation of Encapsulation
PACKAGES
Understanding Packages
Setting Class path
Reading Input from Keyboard
Access Modifiers
ARRAYS
General Definition of Array
Advantages of Array
Arrays in Java
1-D Array
2-D Array
Array of reference type
Operations on Arrays
EXCEPTION HANDLING
Types of Runtime Errors
Understanding Exception
Working with STRING
What is String
String Class
Creating String Object
Operations on String
Designing your web Database
Relational Database
Concepts
How to Design Your
Database
4
Introduction to WEB: -
What is web?
The Web is the common name for the World Wide Web, a subset of the Internet consisting
of the pages that can be accessed by a Web browser. Many people assume that the Web is the
same as the Internet, and use these terms interchangeably. However, the term Internet refers to the
global network of servers that makes the information sharing that happens over the Web possible.
So, although the Web does make up a large portion of the Internet, but they are not one and same.
Web Features: -
Easy navigation.
Trendy, intuitive design and user experience<
Relevant, authoritative website content<
Product visuals and descriptions<
Social media as an extension of the business website<
Company blog<
Core HTML: -
Introduction: -
HTML stands for HyperText Markup Language. It is used to design web pages
using a markup language. HTML is the combination of Hypertext and Markup language.
Hypertext defines the link between web pages. A markup language is used to define the text
document within the tag which defines the structure of web pages. This language is used to
annotate (make notes for the computer) text so that a machine can understand it and manipulate
text accordingly. Most markup languages (e.g., HTML) are human-readable. The language uses
tags to define what manipulation has to be done on the text.
Head section: -
The <head> element is a container for metadata (data about data) and is placed
between the <html> tag and the <body> tag. HTML metadata is data about the HTML
document. Metadata is not displayed. Metadata typically define the document title, character set,
styles, scripts, and other meta information.
Body Section: -
The <body> tag defines the document's body. The <body> element contains all the
contents of an HTML document, such as headings, paragraphs, images, hyperlinks, tables, lists,
etc. Note: There can only be one <body> element in an HTML document.
5
HTML forms: -
HTML Form is a document which stores information of a user on a web server using
interactive controls. An HTML form contains different kind of information such as username,
password, contact number, email id etc. The elements used in an HTML form are check box, input
box, radio buttons, submit buttons etc.
Introduction to CSS: -
CSS Basics: -
Like HTML, CSS is not a programming language. It's not a markup language
either. CSS is a style sheet language. CSS is what you use to selectively style HTML
elements. For example, this CSS selects paragraph text, setting the color to red:
p{
color: red;
}
CSS Introduction: -
Styling Fonts: -
1. CSS Font color: This property is used to change the color of the text. (Standalone
attribute)
2. CSS Font family: This property is used to change the face of the font.
3. CSS Font size: This property is used to increase or decrease the size of the font.
4. CSS Font style: This property is used to make the font bold, italic, or oblique.
5. CSS Font variant: This property creates a small-caps effect.
6. CSS Font weight: This property is used to increase or decrease the boldness and
lightness of the font.
Styling Text: -
CSS defines five generic names for fonts: serif, sans-serif, monospace, cursive, and
fantasy.
These are very generic and the exact font face used from these generic names can vary
between each browser and each operating system that they are displayed on.
6
Introduction to JAVA: -
Why Java was developed?
The Java programming language originated as part of a research project to develop advanced
software for a wide variety of network devices and embedded systems. The goal was to
develop a small, reliable, portable, distributed, real-time operating platform.
History of JAVA: -
The history of Java is very interesting. Java was originally designed for interactive
television, but it was too advanced technology for the digital cable television industry at the time.
The history of Java starts with the Green Team. Java team members (also known as Green Team),
initiated this project to develop a language for digital devices such as set-top boxes, televisions,
etc. However, it was best suited for internet programming. Later, Java technology was
incorporated by Netscape.
7
Variables: -
A variable is a container which holds the value while the Java program is executed.
A variable is assigned with a data type. Variable is a name of memory location. There are
three types of variables in java: local, instance and static. There are two types of data types
in Java: primitive and non-primitive.
Literals: -
Literals in Java are a synthetic representation of boolean, character,
numeric, or string data. They are a means of expressing particular values within a
program. They are constant values that directly appear in a program and can be assigned
now to a variable.
Data Types: -
Data types specify the different sizes and values that can be stored in the variable.
There are two types of data types in Java:
Primitive data types: The primitive data types include boolean, char, byte,
short, int, long, float and double.
Non-primitive data types: The non-primitive data types
include Classes, Interfaces, and Arrays.
Operators: -
Looping Statements: -
The Java for loop is used to iterate a part of the program several times. If the
number of iterations is fixed, it is recommended to use for loop
8
Condition Statements: -
Java has the following conditional statements: Use if to specify a block of code to be
executed, if a specified condition is true. Use else to specify a block of code to be executed, if the
same condition is false. Use else if to specify a new condition to test, if the first condition is false.
Type Casting: -
In Java, type casting is a method or process that converts a data type into another data
type in both ways manually and automatically. The automatic conversion is done by the
compiler and manual conversion performed by the programmer. In this section, we will discuss
type casting and its types with proper examples.
Comments: -
Comments in Java are the statements that are not executed by the compiler and
interpreter. It can be used to provide information or explanation about the variable, method,
class, or any statement. It can also be used to hide program code for a specific time.
OOP implementation: -
Why OOP?
OOP provides a clear structure for the programs. OOP helps to keep the Java code
DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug.
OOP makes it possible to create full reusable applications with less code and shorter
development time.
9
Reference Variable: -
A reference variable is a variable that points to an object of a given class, letting you
access the value of an object. An object is a compound data structure that holds values that you
can manipulate. A reference variable does not store its own values.
Constructors: -
Constructor in java is used to create the instance of the class. Constructors are almost
similar to methods except for two things - its name is the same as the class name and it has no
return type. Sometimes constructors are also referred to as special methods to initialize an object.
Instance variables are just variables defined inside a class, and every instance of a
class can have a different value for an instance variable. In this module, we'll look at defining
static variables in our Java classes.
Static variables are also defined as variables inside a class, but with the keyword
'static'.
Static methods are the methods in Java that can be called without creating an object of
class. Static method is declared with static keyword. Instance method is not with static keyword.
This keyword refers to the current object in a method or constructor. The most
common use of this keyword is to eliminate the confusion between class attributes and parameters
with the same name (because a class attribute is shadowed by a method or constructor parameter).
Inheritance in Java is a mechanism in which one object acquires all the properties and
behaviours of a parent object. It is an important part of OOPs (Object Oriented programming
system).The idea behind inheritance in Java is that you can create new classes that are
built upon existing classes.
When you inherit from an existing class, you can reuse methods and fields of the parent class.
Moreover, you can add new methods and fields in your current class also.
10
Object Class as Root of java class hierarchy: -
Class Object is the root of the class hierarchy. Every class has Object as a
superclass. All objects, including arrays, implement the methods of this class.
Variable Hiding: -
Variable Hiding happens when a variable declared in the child class has the
same name as the variable declared in the parent class. In contrast, variable
shadowing happens when a variable in the inner scope has the same name as the
variable in the outer scope.
Method Hiding: -
In this section, we will discuss what is method hiding in Java, method hiding factors
(MHF), and the differences between method hiding and method overriding. Also, implement
the method hiding concept in a Java program. To understand the method hiding concept in
Java, first, we will understand the method overriding. Because the method hiding concept is very
similar to the method overriding.
If subclass (child class) has the same method as declared in the parent class, it is known as
method overriding in Java. In other words, if a subclass provides the specific implementation of
the method that has been declared by one of its parent classes, it is known as method overriding.
The final keyword in java is used to restrict the user. The java final keyword can be used
in many contexts. Final can be:
11
1. Variable.
2. method.
3. class.
Constructor Chaining: -
Static Binding: The binding which can be resolved at compile time by compiler is
known as static or early binding. Binding of all the static, private and final methods is done
at compile-time.
Dynamic Binding: When type of the object is determined at run-time, it is known as
dynamic binding.
12
Run time Polymorphism: -
Runtime polymorphism, also known as the Dynamic Method Dispatch, is a process that
resolves a call to an overridden method at runtime. The process involves the use of the
reference variable of a superclass to call for an overridden method.
The abstract keyword is a non-access modifier, used for classes and methods:
Abstract class: is a restricted class that cannot be used to create objects (to access it, it must be
inherited from another class). Abstract method: can only be used in an abstract class, and it does
not have a body.
Understanding Interfaces: -
Implementation of Encapsulation: -
In encapsulation, the variables of a class will be hidden from other classes, and can be
accessed only through the methods of their current class. Therefore, it is also known as data
hiding. Declare the variables of a class as private. Provide public setter and getter methods to
modify and view the variables values.
PACKAGES: -
Understanding Packages: -
Class path is a parameter in the Java Virtual Machine or the Java compiler
13
that specifies the location of user-defined classes and packages. The parameter may be set
either on the command-line, or through an environment variable.
1. import java. util. Scanner; - imports the class Scanner from the library java.util.
2. Scanner scanner = new Scanner (System.in); - creates a new Scanner object, that is
connected to standard input (the keyboard)
3. String inputString = scanner. nextLine ();
Access Modifiers: -
There are two types of modifiers in Java: access modifiers and non-access modifiers.
The access modifiers in Java specifies the accessibility or scope of a field, method,
constructor, or class. We can change the access level of fields, constructors, methods, and class by
applying the access modifier on it.
1. Private: The access level of a private modifier is only within the class. It cannot be
accessed from outside the class.
2. Default: The access level of a default modifier is only within the package. It cannot be
accessed from outside the package. If you do not specify any access level, it will be the
default.
3. Protected: The access level of a protected modifier is within the package and outside the
package through child class. If you do not make the child class, it cannot be ac- cessed
from outside the package.
4. Public: The access level of a public modifier is everywhere. It can be accessed from
within the class, outside the class, within the package and outside the package.
ARRAYS: -
An array is a container object that holds a fixed number of values of a single type.
The length of an array is established when the array is created. After creation, its length is fixed.
Advantages of Array: -
14
Primitive type to wrapper classes object conversion will not happen so it is fast.
Array can store many number of elements at a time.
Arrays in Java: -
An array is a collection of similar types of data. For example, if we want to store the
names of 100 people then we can create an array of the string type that can store 100 names.
String [] array = new String [100];
Here, the above array cannot store more than 100 names.
1-D Array (One-Dimensional Array): -
One-dimensional array or single dimensional array must deal with values of only one
data type. One dimensional array can also store multiple objects of the same class. An array in
java is an object of a dynamically generated class that can be initialized and created using the
new operator.
2-D Array (Two-Dimensional Array): -
Here i and j are the size of the two dimensions, i.e., i denotes the number of rows while j
denotes the number of columns. Example: int A [10][20]; Here we declare a two- dimensional
array in C, named A which has 10 rows and 20 columns.
Array, which itself is derived from System. Object. This means that all arrays are always
reference types which are allocated on the managed heap, and your app's variable contains a
reference to the array and not the array itself.
Operations on Arrays: -
Traverse − print all the array elements one by one. Insertion − Adds an element at
the given index. Deletion − Deletes an element at the given index. Search − Searches an
element using the given index or by the value.
EXCEPTION HANDLING: -
1. Arithmetic Exception
2. NullPointerException
3. ClassCastException
4. DateTimeException
5. ArrayIndexOutOfBoundsException.
15
Understanding Exception: -
An exception (or exceptional event) is a problem that arises during the execution of a
program. When an Exception occurs the normal flow of the program is disrupted and the
program/Application terminates abnormally, which is not recommended, therefore, these
exceptions are to be handled.
An exception can occur for many different reasons. Following are some scenarios where an
exception occurs.
A user has entered an invalid data.
A file that needs to be opened cannot be found.
A network connection has been lost in the middle of communications or the
JVM has run out of memory.
Strings, which are widely used in Java programming, are a sequence of characters. In
the Java programming language, strings are objects. The Java platform provides the String class to
create and manipulate strings.
String Class: -
The String class represents character strings. All string literals in Java programs, such
as "abc,” are implemented as instances of this class. Strings are constant; their values cannot be
changed after they are created. String buffers support mutable strings. Because String objects are
immutable, they can be shared.
1. By string literal: Java String literal is created by using double quotes. For Example:
String s= “Welcome;”
2. By new keyword: Java String is created by using a keyword “new”. For example:
String s=new String(“Welcome”);
Operations on String: -
Java String class provides a lot of methods to perform operations on strings such as
compare (), concat (), equals (), split (), length (), replace ().
16
String operators represent the various types of operations that we can employ on the
string type of the variables in the program. Moreover, python lets us apply numerous string
operators on the python string and these are explained well in this article.
This tutorial provides an example on how to create a Database using JDBC application.
Before executing the following example, make sure you have the following in place −
You should have admin privilege to create a database in the given schema. To
execute the following example, you need to replace the username and pass- word
with your actual user name and password.
Your MySQL or whatever database is up and running.
Required Steps
The following steps are required to create a new Database using JDBC application −
Import the packages − Requires that you include the packages containing the
JDBC classes needed for database programming. Most often, using import
java.sql. * Will suffice.
Open a connection − Requires using the DriverManager.getConnec- tion()
method to create a Connection object, which represents a physical con- nection
with the database server.
To create a new database, you need not give any database name while preparing
database URL as mentioned in the below example.
Execute a query − Requires using an object of type Statement for building and
submitting an SQL statement to the database.
Clean up the environment. try with resources automatically closes the re-
sources.
Introduction to My SQL: -
MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses.
MySQL is developed, marketed and supported by MySQL AB, which is a Swedish company.
MySQL is becoming so popular because of many good reasons −
MySQL is released under an open-source license. So, you have nothing to pay to
use it.
MySQL is a very powerful program in its own right. It handles a large subset of
the functionality of the most expensive and powerful database packages.
MySQL uses a standard form of the well-known SQL data language.
MySQL works on many operating systems and with many languages including
PHP, PERL, C, C++, JAVA, etc.
MySQL works very quickly and works well even with large data sets.
MySQL is very friendly to PHP, the most appreciated language for web devel-
opment.
MySQL supports large databases, up to 50 million rows or more in a table. The
default file size limit for a table is 4GB, but you can increase this (if your op-
erating system can handle it) to a theoretical limit of 8 million terabytes (TB).
MySQL is customizable. The open-source GPL license allows programmers to
modify the MySQL software to fit their own specific environments.
17
Setting Up a user for the web: -
With a user account, a visitor creates a personalized profile on your website in order to
tailor their experience with your web content.
All of these benefits help you gain consumer trust and convert visitors into engaged leads.
After all, they’re called “user accounts,” not “visitor accounts.”
Many sites can gain from providing user accounts, regardless of the product or industry. If your
website...
facilitates e-commerce and stores users’ payment information, orders, and/or carts
hosts private user-provided content, like cloud storage, notes, or e-journal entries
uses visitor-related information to tailor the browsing experience to individuals then you
will likely need user accounts on your website.
But before you continue, consider whether it’s best for your specific site to suggest or
require accounts. An account should first and foremost enhance the user experience, so
make sure the benefits to the customer are worth the time and effort of signing up.
No one should feel “forced” to create an account when they don’t need to.
1. Click File > Open, and click the database if it is listed under Recent. If not, select one
of the browse options to locate the database.
2. In the Open dialog box, select the database that you want to open, and then click
Open.
3. On the Create tab, in the Tables group, click Table.
18
Working with Your My SQL Database: -
Inserting Data: -
Data insertion is the process of inserting rows into a table. The data insertion methods
and an example of specifying SQL statements are shown as follows. The INSERT statement is
used to insert rows.
Data insertion methods
The INSERT statement is used to insert rows. The following two methods are
available for inserting rows into a table:
Example
In this example, the INSERT statement inserts in each column of the stock table
(STOCK) the values set in embedded variables (: ZPCODE, ZPNAME, ZCOLOR,
ZPRICE, and: ZSQUANTITY) that are used for transferring values between a table and
UAPs:
Retrieving Data: -
Updating Data: -
The modification of data that is already in the database is referred to as updating. You
can update individual rows, all the rows in a table, or a subset of all rows. Each column can be
updated separately; the other columns are not affected.
To update data in a table, you need to: First, specify the table name that you want to
change data in the UPDATE clause. Second, assign a new value for the column that you
want to update.
19
In case you want to update data in multiple columns, each column = value pair is separated by a
comma (,).
The SQL ALTER TABLE command is used to change the structure of an existing
table. It helps to add or delete columns, create, or destroy indexes, change the type of existing
columns, or rename columns or the table itself. It can also be used to change the comment for the
table and type of the table.
20
21