basic html tags

about HTML tags:
HTML tags are the building blocks of an HTML document. They are used to create and structure the content of a webpage.

Some common HTML tags include:

<html>: defines the start and end of an HTML document.

<head>: contains meta-information about the document, such as the title, displayed in the browser's title bar or tab.

<body>: contains the main content of the document.

<p>: defines a paragraph.

<a>: creates a hyperlink.

<img>: displays an image.

<div>: creates a container for HTML elements, which can be used to group elements together and apply styles to them.

<header>: defines a header for a document or section.

<nav>: defines navigation links.

<main>: defines the main content of a document,

<footer>: defines a footer for a document or section.

<form>: creates an HTML form for user input.

<input>: creates form controls, such as text fields, checkboxes, and buttons, for user input.

These are some of the most common HTML tags, but there are many other tags as well.
refer The website can be found at https://www.w3.org/html/.

introduction to html


why HTML?

HTML (Hypertext Markup Language) is used to create the structure and layout of web pages. It is the foundation of any website and is used to define the structure of a web page by using a set of tags, such as headings, paragraphs, lists, images, and links. HTML allows developers to create visually appealing and interactive web pages, which can be displayed in any web browser. It also provides a way to add semantic meaning to the content of a web page, making it easier for search engines and other web-based tools to understand the purpose and structure of the page. Overall, HTML is a key building block for the web and is essential for creating effective and engaging websites.

what is HTML5:

HTML5 is the fifth and current version of the Hypertext Markup Language (HTML), the standard programming language for creating web pages. HTML5 includes new features such as video playback, improved semantic support, and new elements for structuring web content. It is designed to be more flexible and efficient than previous versions of HTML, and it is compatible with a wide range of devices and web browsers.

Basic HTML code example:

<!DOCTYPE html>
<html>
<head>
    <title>My Web Page</title>
</head>
<body>
    <h1>Welcome to My Web Page</h1>
    <p>This is a simple example of an HTML webpage.</p>
    <a href="https://zaheerintrovert.blogspot.com/">Visit my website</a>
</body>
</html>

The code starts with the <!DOCTYPE> declaration, which tells the web browser which version of HTML is being used. 
The <html> element is the container for all other HTML elements on the page.
The <head> element contains information about the web page, such as the title that appears in the browser's title bar or tab.
The <body> element contains the content of the web page, such as headings, paragraphs, lists, images, and links.
In this example, the <h1> element is used to create a heading, the <p> element is used for a paragraph, and <a> for creating links.
This is a very basic example and there are many more tags that you can use to create more complex and sophisticated web pages.

The official website for HTML is the W3C website, which is the organization that sets the standards for web technologies such as HTML, CSS, and JavaScript.
The website can be found at https://www.w3.org/html/
On the website, you can find the latest specifications and recommendations for HTML, as well as information on the latest features and updates. You can also find resources such as tutorials, guides, and tools to help you learn and develop with HTML. The website also has a section called "HTML5" which is the latest version of HTML, and you can find all the latest information and development on this version.

HTML entities Converter

HTML Entities Converter

Code copied to the clipboard!
Output:

vs code shortcuts you must know

  
Some useful vscode shortcuts you must know which save your time.

1. To open vs code from the command prompt 
cmd> code .

2. To open a terminal in vs code 
ctrl + `


java naming conventions

codewithzaheer

Java naming conventions

java is a case sensitive language, that means there is a seperate recognization for uppercase letters and lower case letters.

Exampleabcis not equal to ABC(ABC != abc).

java has the following naming conventions, they are


all classes, abstract classes, and interfaces Names must be started with uppercase letters and their subsequent symbols must be uppercase letters.

Example:

String

StringBuffer


all variables must be started with lowercase letters and subsequent symbols must be uppercase letters.

Example:

nameIsZaheer


all methods must be started with lowercase letters and subsequent symbols must be uppercase letters.

Example:

additionWithTwoParameters()

additionWithThreeParameters()


all constant variables must be in uppercase letters only.

Example:

GLOBAL_VARIABLE


All the package names must be in lowercase letters.

Example:

com.zaheerintrovert.javanamingconventions



Why Java is a Platform Independent Language?


we write code in a high-level language which is human understandable language.
which is not understood by machines so the machine uses a compiler to convert 
the code from high level to machine level or low-level code.

if we take other languages like c and c++
the machine-level code differs by programming language and operating system.
i.e.,
c and c++ generate a .exe file that is not the same for two machines if they are 
running on a different os(operating system)Linux and windows.

i.e., when c and c++ files get compiled they generate the .exe file which is a directly executable file, and these are built or generated on a particular os only 
and for their execution, they will have a system call on the same os.

so if we compile the files in one os and execute them on other can't be possible in these languages.
if you compiled c and c++ files in one os you should execute those files on the same os i.e, machine-level code differs by each operating system. 
so these are platform-dependent.

whereas java is different from these languages

When we compile the java file by the command “javac filename.java” creates an intermediate code called Bytecode.

bytecode is independent of the platforms.
This is where java makes difference between all different programming languages.
 It creates a .class file, which is considered bytecode. Whereas languages 
like c and c++ will create an executable code when they are compiled and thus makes them platform dependent.

and This byte code is not executable. We need a translator for executing this bytecode. 
And JVM does this job. Generally, JVM resides in the main memory of our computer. 
JVM acts as an interpreter and executes the bytecode generated by the compiler.

reading data from keyboard

codewithzaheer

To read the input values in java

Scanner class is used to read data from keyboard, and it is from util package.

below program "addition of two numbers"

package basics;

import java.util.Scanner;

public class readFromKeyboard {

public static void main(String[] args) {

Scanner read = new Scanner(System.in);

int FirstNumber;

int SecondNumber;

int Result;

System.out.println("enter first number");

FirstNumber = read.nextInt();

System.out.println("enter second number");

SecondNumber = read.nextInt();

Result = FirstNumber + SecondNumber;

System.out.println("the result is " + Result);

}

}


note:

To know the methods present in that scanner class we have the command javap java.util.Scanner

To check it open the command prompt and enter the command, then you will get the list of methods present in the scanner Class.

Some of the methods are listed below

nextInt()

nextFloat()

nextDouble()

next()

nextLine()

nextBoolean()

nextByte()

nextShort()

nextLong()

etc...