Semantic Elements in HTML5

Html5 introduces well named semantic elements. It means every element and its name is given to defined a unique purpose. for example <div> and <span> can be used for anywhere in the page and each time it has different purpose for use and these are termed as non semantic elements. but when you see <table>, <form> etc are defined for a unique purpose so these elements are termed as semantic elements.

New Semantic elements Introduced in Html5 are ,

HTML5 offers new semantic elements to clearly define different parts of a web page:

  • <header>
  • <nav>
  • <section>
  • <article>
  • <aside>
  • <figcaption>
  • <figure>
  • <footer>
Semantic Elements in HTML5

Difference between Cookies vs Session Storage vs local Storage

Cookies are small text files placed in a browser to manage session in the web applications.

Local Storage and Session Storage are new objects introduced in html5 and both of then are storage specifications based on scope and duration.

LocalStorage is permanent and website specific whereas Session Storage only lasts as long as the duration of the longest open tab.

Data attributes in HTML 5

The new feature in html5 is the data attributes. These will be used to assign custom data to html elements. It is used to store sensitive or private to the page or application to which there is no other matching attributes or elements.

Newly introduced Input Types in HTML 5

The new form elements added in the HTML 5

number -
email – Use this input type to avoid writing complex logic to validate e-mail address.
url – This input type is specially added to support the URL

What are class loader and how they work in java?

Class loaders are hierarchical and use a delegation model when loading a class. Class loaders request their parent to load the class first before attempting to load it themselves. When a class loader loads a class, the child class loaders in the hierarchy will never reload the class again. Hence uniqueness is maintained. Classes loaded by a child class loader have visibility into classes loaded by its parents up the hierarchy but the reverse is not true.

What is the Use of Java packages?

It helps resolve naming conflicts when different packages have classes with the same names. This also helps you organize files within your project. For example: package do something related to I/O and package do something to do with network and so on. If we tend to put all .java files into a single package, as the project gets bigger, then it would become a nightmare to manage all your files.

You can create a package as follows with package keyword, which is the first keyword in any Java program followed by import statements. The java.lang package is imported implicitly by default and all the other packages must be explicitly imported.

package ;

Explain the basic components of Java Platforms?

The Java platform has 2 components:

  • Java Virtual Machine (JVM) – ‘JVM’ is a software that can be ported onto various hardware platforms. Byte codes are the machine language of the JVM.
  • Java Application Programming Interface (Java API) – set of classes written using the Java language and run on the JVM.

What are valid reasons for using Java?

  • Built-in support for multi-threading, socket communication, and memory management (automatic garbage collection).
  • Object Oriented (OO).
  • Better portability than other languages across operating systems.
  • Supports Web based applications (Applet, Servlet, and JSP), distributed applications (sockets, RMI, EJB etc) and network protocols (HTTP, JRMP etc) with the help of extensive standardized APIs (Application Programming Interfaces).