1) servlet vs httpservlet
2) what is SMTP
SMTP
o SMTP stands for Simple Mail Transfer Protocol.
o SMTP is a set of communication guidelines that allow software to
transmit an electronic mail over the internet is called Simple Mail
Transfer Protocol.
o It is a program used for sending messages to other computer users
based on e-mail addresses.
o It provides a mail exchange between users on the same or different
computers, and it also supports:
o It can send a single message to one or more recipients.
o Sending message can include text, voice, video or graphics.
o It can also send the messages on networks outside the
internet.
3) diff between class and object.
No. Object Class
1) Object is an instance of a class. Class is a blueprint or
template from which
objects are created.
2) Object is a real world entity such as Class is a group of
pen, laptop, mobile, bed, keyboard, similar objects.
mouse, chair etc.
3) Object is a physical entity. Class is a logical entity.
4) Object is created through new Class is declared
keyword mainly e.g. using class
Student s1=new Student(); keyword e.g.
class Student{}
5) Object is created many times as per Class is declared once.
requirement.
6) Object allocates memory when it is Class doesn't
created. allocated memory
when it is created.
7) There are many ways to create There is only one way
object in java such as new keyword, to define class in java
newInstance() method, clone() method, using class keyword.
factory method and deserialization.
Polymorphism is an important concept of object-oriented programming. It
simply means more than one form.
That is, the same entity (method or operator or object) can perform different
operations in different scenarios.
class Polygon {
// method to render a shape
public void render() {
[Link]("Rendering Polygon...");
class Square extends Polygon {
// renders Square
public void render() {
[Link]("Rendering Square...");
class Circle extends Polygon {
// renders circle
public void render() {
[Link]("Rendering Circle...");
class Main {
public static void main(String[] args) {
// create an object of Square
Square s1 = new Square();
[Link]();
// create an object of Circle
Circle c1 = new Circle();
[Link]();
We can achieve polymorphism in Java using the following ways:
1. Method Overriding
2. Method Overloading
q) inheritance, is-a relationship with example
Introduction
In Java, we can reuse our code using an Is-A relationship or using a Has-A
relationship. An Is-A relationship is also known as inheritance and a Has-A
relationship is also known as composition in Java.
Is-A Relationship in Java
In Java, an Is-A relationship depends on inheritance. Further inheritance is
of two types, class inheritance and interface inheritance. It is used for code
reusability in Java. For example, a Potato is a vegetable, a Bus is a vehicle,
a Bulb is an electronic device and so on. One of the properties of
inheritance is that inheritance is unidirectional in nature. Like we can say
that a house is a building. But not all buildings are houses. We can easily
determine an Is-A relationship in Java. When there is an extends or
implement keyword in the class declaration in Java, then the specific class
is said to be following the Is-A relationship.
Has-A Relationship in Java
In Java, a Has-A relationship is also known as composition. It is also used
for code reusability in Java. In Java, a Has-A relationship simply means
that an instance of one class has a reference to an instance of another
class or an other instance of the same class. For example, a car has an
engine, a dog has a tail and so on. In Java, there is no such keyword that
implements a Has-A relationship. But we mostly use new keywords to
implement a Has-A relationship in Java.
Q) diff between hasmap and hashtable
Difference Between Hashmap and Hashtable
S.
No. Hashmap Hashtable
1. No method is synchronized. Every method is synchronized.
Multiple threads can operate At a time only one thread is allowed
simultaneously and hence hashmap’s to operate the Hashtable’s object.
2. object is not thread-safe. Hence it is thread-safe.
It increases the waiting time of the
Threads are not required to wait and thread and hence performance is
3. hence relatively performance is high. low.
Null is not allowed for both key and
Null is allowed for both key and value. Otherwise, we will get a null
4. value. pointer exception.
5. It is introduced in the 1.2 version. It is introduced in the 1.0 version.
6. It is non-legacy. It is a legacy.
why multiple inheritance is not supported through classes but it is possible
by interfaces?
why should we create reference of super class or abstract class reference?
What is JavaScript Cursor
JavaScript cursor is a thing used as a mouse cursor whenever it’s
going to point on specific elements. There are various types of
cursor available those are like wait, help, move, pointer,
crosshair, cell, not allowed, zoom-in, zoom-out, etc. This cursor
can be changed by assigning value to
[Link]. JavaScript also helps us to hide the
cursor, it should be hide cursor from a webpage, hide cursor for a
particular element, and with the help of CSS we are able to set
the cursor to none. By using JavaScript along with CSS we can
create varieties of a different cursor. We will see all those one by
one in detail later.
Delete row
DELETE FROM Customers WHERE CustomerName='Alfreds Futterkiste';
DROP COLUMN
The DROP COLUMN command is used to delete a column in an existing table.
The following SQL deletes the "ContactName" column from the "Customers"
table:
Example
ALTER TABLE Customers
DROP COLUMN ContactName;
what is react and why we use react and over angular?
What is React?
React is a front-end JavaScript library that allows you to build
user interfaces from reusable UI components. React uses server-side
rendering to provide a flexible and performance-based solution. It
allows developers to create seamless UX and complex UI.
What does React have over Angular?
JSX Advantage
Building Blocks Flexibility
Isomorphic JavaScript
Single Data Binding
Advantages of React JS
React JS offers many excellent front-end benefits to users and developers. Here are some of the
prime advantages of React JS you can leverage:
React offers an easy debugging process. The code is reusable.
It’s easy to learn because of its easy and simple design.
It allows developers to migrate an app in React very easily.
It supports both Android and iOS platforms.
ReactJS is view-oriented.
It has faster updates with both server-side and front-end support.
It supports a React Native library that offers efficient performance.
What is Angular?
Angular is an open-source JavaScript front-end framework developed and managed by Google’s
Angular team. Angular is the most popular client-side framework for developing scalable and high-
performing mobile and web apps using HTML, CSS, and TypeScript. The latest version of Angular is
Angular 13, which offers enterprise-ready web app development solutions.
Angular is a complete rewrite of AngularJS (Angular 1.0) released in 2010. However, if you are not
aware of the difference between Angular vs AngularJS, you can read our blog for better clarity. The
MVC (Model View Controller) technique is used by Angular, which divides work into logical pieces
and speeds up the initial webpage loading time.
What does Angular have over React?
MVC Model
Dependency Injection
Out-of-the-box Full Stack Framework
Two-way Data Binding
Amazing App Structure
Benefits of Angular
Let’s understand the benefits of Angular:
Angular offers clean code development and dependency injection.
You can use many Angular libraries, which help you create robust template solutions.
To execute a unit test in Angular, you need to inject mock data into the controller, then inspect the
result and its behavior. Also, it allows you to create every single page separately and then combine
them with the components to view the final product.
It offers a single routing option. Also, it has interactive UIs with data binding.
Angular extends HTML syntax. With directives, Angular lets you create reusable components.
Must have synchronized data between the model view and the component.
Why React is better than Angular?
In terms of performance, bundle size, and backward compatibility, React
outperforms Angular. The component-driven architecture of React allows
developers to reuse components, which tends to save cost and time
Q) latest version of my sql?
Q) latest version of React?
Difference between State and Props
SN Props State
1. Props are read-only. State changes can be
asynchronous.
2. Props are immutable. State is mutable.
3. Props allow you to pass data from one State holds information about the
component to other components as an components.
argument.
4. Props can be accessed by the child State cannot be accessed by child
component. components.
5. Props are used to communicate States can be used for rendering
between components. dynamic changes with the
component.
6. Stateless component can have Props. Stateless components cannot
have State.
7. Props make components reusable. State cannot make components
reusable.
8. Props are external and controlled by The State is internal and
whatever renders the component. controlled by the React
Component itself.
Q)JSX?
JSX stands for JavaScript XML.
JSX allows us to write HTML in React.
JSX makes it easier to write and add HTML in React.
Q) what is Ajax?
AJAX = Asynchronous JavaScript And XML.
AJAX allows web pages to be updated asynchronously by exchanging data
with a web server behind the scenes. This means that it is possible to update
parts of a web page, without reloading the whole page.
Q). what is session and diff between session and cookies?
1. Session :
A session is used to save information on the server momentarily so that it
may be utilized across various pages of the website. It is the overall amount
of time spent on an activity. The user session begins when the user logs in to
a specific network application and ends when the user logs out of the
program or shuts down the machine
Difference Between Session and Cookies :
Cookie Session
Cookies are client-side files on a Sessions are server-side files that contain user
local computer that hold user data.
information.
Cookies end on the lifetime set by When the user quits the browser or logs out of
the user. the programmed, the session is over.
It can only store a certain amount
of info. It can hold an indefinite quantity of data.
We can keep as much data as we like within a
session, however there is a maximum memory
The browser’s cookies have a restriction of 128 MB that a script may consume
maximum capacity of 4 KB. at one time.
Because cookies are kept on the
local computer, we don’t need to To begin the session, we must use the session
run a function to start them. start() method.
Cookies are not secured. Session are more secured compare than cookies.
Cookies stored data in text file. Session save data in encrypted form.
Cookies stored on a limited data. Session stored a unlimited data.
In PHP, to get the data from
Cookies , $_COOKIES the global In PHP , to set the data from Session,
variable is used $_SESSION the global variable is used
In PHP, to destroy or remove the data stored
We can set an expiration date to within a session, we can use the
delete the cookie’s data. It will session_destroy() function, and to unset a
automatically delete the data at specific variable, we can use the unset()
that specific time. function.
Q).what is cloud computing?
Cloud computing is the delivery of different services through the Internet.
These resources include tools and applications like data storage, servers,
databases, networking, and software.
Rather than keeping files on a proprietary hard drive or local storage device,
cloud-based storage makes it possible to save them to a remote database. As
long as an electronic device has access to the web, it has access to the data
and the software programs to run it.
Cloud computing is a popular option for people and businesses for a number of
reasons including cost savings, increased productivity, speed and efficiency,
performance, and security.
KEY TAKEAWAYS
Cloud computing is the delivery of different services through the Internet,
including data storage, servers, databases, networking, and software.
Cloud storage has grown increasingly popular among individuals who need
larger storage space and for businesses seeking an efficient off-site data back-
up solution.
Cloud-based storage makes it possible to save files to a remote database and
retrieve them on demand.
Services can be both public and private—public services are provided online
for a fee while private services are hosted on a network to specific clients.
Cloud security has become an increasingly important field in IT.
Types of Cloud Services
Regardless of the kind of service, cloud computing services provide users
with a series of functions including:
Email
Storage, backup, and data retrieval
Creating and testing apps
Analyzing data
Audio and video streaming
Delivering software on demand
Types of Cloud Computing
Cloud computing is not a single piece of technology like a microchip or a
cellphone. Rather, it's a system primarily comprised of three
services: software-as-a-service (SaaS), infrastructure-as-a-service (IaaS),
and platform-as-a-service (PaaS).
1. Software-as-a-service (SaaS) involves the licensure of a software
application to customers. Licenses are typically provided through a
pay-as-you-go model or on-demand. This type of system can be
found in Microsoft Office's 365.1
2. Infrastructure-as-a-service (IaaS) involves a method for delivering
everything from operating systems to servers and storage through
IP-based connectivity as part of an on-demand service. Clients can
avoid the need to purchase software or servers, and instead procure
these resources in an outsourced, on-demand service. Popular
examples of the IaaS system include IBM Cloud and Microsoft
Azure.12
3. Platform-as-a-service (PaaS) is considered the most complex of
the three layers of cloud-based computing. PaaS shares some
similarities with SaaS, the primary difference being that instead of
delivering software online, it is actually a platform for creating
software that is delivered via the Internet. This model includes
platforms like [Link] and Heroku
Q). do you know the name of the technology which is use for cloud computing?
Cloud Computing Technologies - javatpoint
Q). computing model?
Cloud Computing Models (IaaS, PaaS & SaaS)
Q). what is dynamic and static programming?
Static languages
In static languages, the type can not be changed once a
variable is created. If a variable type is defined, then only the
value of the variable can be changed, but the type is static and
cannot be changed. This means that if we define an integer, we
can only update its value and no other data type can be assigned
to it.
This makes the code robust since type-checking is done during
compile-time. Static languages might have a slow development
cycle due to an extra step of compilation. Moreover, while
accessing a variable, the data type is already known, which
avoids the need for extra checks.
C++, Java, Go and C# are statically typed languages.
Dynamic languages
In dynamic languages, the types and values are both dynamic,
which means the types and values can both be changed. For
example, a variable that was previously assigned an integer can
be assigned a string. The type checking is done during run time.
The dynamic languages are usually not compiled, but
interpreted. Due to the dynamic types, there might be increased
chances of type errors. However, due to the absence of the
compilation step, the development is fast.
JavaScript, Ruby, and PHP are examples of dynamically typed
languages.
Q). how connect SQL database with the web server
Q) What is Spring Boot
Spring Boot provides a good platform for Java developers to develop a stand-
alone and production-grade spring application that you can just run. You can
get started with minimum configurations without the need for an entire Spring
configuration setup.
Q). What is Micro Service?
Micro Service is an architecture that allows the developers to develop and
deploy services independently. Each service running has its own process
and this achieves the lightweight model to support business applications.
Q). What is [Link]? Explain its architecture.
A Project Object Model or POM is the fundamental unit of work in Maven. It
is an XML file that contains information about the project and
configuration details used by Maven to build the project. It contains
default values for most projects. Examples for this is the build directory,
which is target; the source directory, which is src/main/java; the test
source directory, which is src/test/java; and so on. When executing a task
or goal, Maven looks for the POM in the current directory. It reads the
POM, gets the needed configuration information, then executes the goal.
Some of the configuration that can be specified in the POM are the project
dependencies, the plugins or goals that can be executed, the build
profiles, and so on. Other information such as the project version,
description, developers, mailing lists and such can also be specified.
Q) What build is used in spring boot.
In Spring Boot, choosing a build system is an important task. We recommend
Maven or Gradle as they provide a good support for dependency management.
Spring does not support well other build systems.