NAME : Abdul Gani
ROLL NO : 201DDE1184
COURSE : MCA
YEAR/SEM : 2nd / 3rd
PAPER CODE : MCA 303
PAPER NAME : (WEB PROGRAMMING)
Q-1. What is Web Browsers ?
Ans:-
A web browser (commonly referred to as a browser) is a software application for accessing
information on the World Wide Web. When a user requests a particular website, the web
browser retrieves the necessary content from a web server and then displays the resulting web
page on the user's device.
A web browser is not the same thing as a search engine, though the two are often confused. [1]
[2]
For a user, a search engine is just a website, such as Google Search, Bing, or
DuckDuckGo, that stores searchable data about other websites. However, to connect to a
website's server and display its web pages, a user must have a web browser installed.[3]
Web browsers are used on a range of devices, including desktops, laptops, tablets, and
smartphones. In 2019, an estimated 4.3 billion people used a browser. [4] The most used
browser is Google Chrome, with a 64% global market share on all devices, followed by
Safari with 17%
the first web browser, called WorldWideWeb, was created in 1990 by Sir Tim Berners-Lee.[6] He then
recruited Nicola Pellow to write the Line Mode Browser, which displayed web pages on dumb
terminals; it was released in 1991.[
Function
The purpose of a web browser is to fetch information resources from the Web and display
them on a user's device.
This process begins when the user inputs a Uniform Resource Locator (URL), such as
https://en.wikipedia.org/, into the browser. Virtually all URLs on the Web start with
either http: or https: which means the browser will retrieve them with the Hypertext
Transfer Protocol (HTTP). In the case of https:, the communication between the browser
and the web server is encrypted for the purposes of security and privacy.
Once a web page has been retrieved, the browser's rendering engine displays it on the user's
device. This includes image and video formats supported by the browser.
Web pages usually contain hyperlinks to other pages and resources. Each link contains a
URL, and when it is clicked or tapped, the browser navigates to the new resource. Thus the
process of bringing content to the user begins again.
Most browsers use an internal cache of web page resources to improve loading times for
subsequent visits to the same page. The cache can store many items, such as large images, so
they do not need to be downloaded from the server again. [15] Cached items are usually only
stored for as long as the web server stipulates in its HTTP response messages.[16]
The most popular browsers have a number of features in common. They allow users to set
bookmarks and browse in a private mode. They also can be customized with extensions, and
some of them provide a sync service.
Most browsers have these user interface features:
Allow the user to open multiple pages at the same time, either in different browser
windows or in different tabs of the same window.
Back and forward buttons to go back to the previous page visited or forward to the
next one.
A refresh or reload button to reload the current page.
A stop button to cancel loading the page. (In some browsers, the stop button is
merged with the reload button.)
A home button to return to the user's home page.
An address bar to input the URL of a page and display it.
A search bar to input terms into a search engine. (In some browsers, the search bar is
merged with the address bar.)
Q-2. Write the steps creating a Web Page?
Ans:-
Step 1. Choose a domain name/URL:-The very first step you’ll want to take when it comes to
creating a website is determining what domain name you want for you website, because before can
create a website/blog your hosting company will ask you to decide on what the name of your
website and URL (domain name) will be.
Step 2. Register your domain name/URL:-After you’ve decided on a domain name and have found
one that is available to use there are a number of registering services that will allow you to register
your chosen domain name, often for very little cost.
Step 3. Choose a hosting service:- After deciding on your domain name and getting it registered the
next step you’ll need to take is finding a hosting service that will host your website.
Step 4. Connect your domain name to your web host:-If you have chosen a web host that offers a
domain name with their hosting service than you can skip this step as most hosting services will
make it easy for you to connect your domain name to your hosting service and will walk your
through the steps as you create your website.
Step 5. Install WordPress:-After you’ve chosen your domain name and created a hosting account
you’ll need to install software that will allow you to manage, customize and build your website as
you like. Whether you want to create a blog, start an online business or build an e-commerce site
WordPress is a great choice for helping you run the back end of your website.
Step 6. Choose a theme for your website:-There are a ton of both free and premium (paid) themes
available for WordPress that allow you to choose a design that suits the look and functionality of
your website.
Step 7. Configure your website:-Now that your website is up and running and you’ve chosen your
theme you’ll want to configure your website so that you provide the best experience for your
visitors.
Step 8. Add content :-If you’ve made it to this part congratulations you’re all set.
Q-3. What is Java Buzzwords?
Java Buzzwords
Two main feature of Java is Portable and Secure but there other reasons why Java is considered as a
powerful programming language are discussed below. These buzzwords were also discussed by the
Java team to describe the power of Java.
1. Simple
2. Secure
3. Portable
4. Object-Oriented
5. Robust
6. Mutithreaded
7. Architecture Neutral
8. Interpreted
9. High Performance
10. Distributed
11. Dynamic
Simple: Java inherits all the best features from the programming languages like C, C++ and
thus makes it really easy for any developer to learn with little programming experience. The
concept of Object Oriented programming was not invented by Java but it was just adopted by
the Java team. Programming notation of Java is not different from the programming language
like C and C++ which makes developers have little trouble to learn Java.
Secure: When Java programs are executed they don’t instruct commands to the machine
directly. Instead Java Virtual machine reads the program (ByteCode) and convert it into the
machine instructions. This way any program tries to get illegal access to the system will not
be allowed by the JVM. Allowing Java programs to be executed by the JVM makes Java
program fully secured under the control of the JVM.
Portable: Java programs are portable because of its ability to run the program on any
platform and no dependency on the underlying hardware / operating system.
Object Oriented Programming Language: Java programming language was influenced
from its previous successors programming language like C++. Java developers did not just
took everything and implemented in Java but they analyzed the current challenges in the
existing language and then included what is necessary.
Robust: Following features of Java make it Robust.
Platform Independent
Object Oriented Programming Language
Memory management
Exception Handling
Platform Independent: Java program are written once and executed on any platform this
makes the job of developer easier to develop programs and not code machine dependent
coding.
Object Oriented Programming Language: helps to break the complex code into easy to
understand objects and manage high complexity programs in distributed team environment.
Memory Management: In traditional programming language like C, C++ user has to
manage memory by allocating and deallocating memory which leads to memory leaks in the
program. In Java, memory management is taken care by the Java Virtual Machine and safe
from memory crashes. All the allocation and clean of the memory is done automatically.
Exception Handling: In Java, developers are forced to handle the exception during the
development time. All the possible exception are errored out during the compilation of the
program. This way when the exception happens during runtime there is proper exception
handling mechanism already coded in the program.
Multithreaded: Java allows you to develop program that can do multiple task
simultaneously. Interactive based programming allows you to write program that responds to
the user actions and helps developers to just implement the logic based on the user action
instead to manage the complete multi-tasking solution.
Architecture-Neutral: The major challenge when Java was developing is to have
programming language with which a program can be developed and executed anytime in
future. With changing environments of hardware, processor, Operating system there was need
to have program still adopt to this architecture changes. Java code does not depend on the
underlying architecture and only depends on it JVM thus accomplish the architecture neutral
programming language.
Interpreter: The compiled code of Java is not machine instructions but rather its a
intermediate code called ByteCode. This code can be executed on any machine that
implements the Java virtual Machine. JVM interprets the ByteCode into Machine instructions
during runtime.
High Performance: When java programs are executed, JVM does not interpret entire code
into machine instructions. If JVM attempts to do this then there will huge performance
impact for the high complexity programs. JVM was intelligently developed to interpret only
the piece of the code that is required to execute and untouch the rest of the code. The
performance of java is never questioned compared with another programming language.
Distributed: Java has a feature called Remote Method Invocation (RMI) using which a
program can invoke method of another program across a network and get the output.
Dynamic: Java programs access various runtime libraries and information inside the
compiled code (Bytecode). This dynamic feature allows to update the pieces of libraries
without affecting the code using it.
-
Q-4. What is Array? Explain with example.
Ans:- An array is a data structure that contains a group of elements. Typically these elements
are all of the same data type, such as an integer or string. Arrays are commonly used in
computer programs to organize data so that a related set of values can be easily sorted or
searched.
For example, a search engine may use an array to store Web pages found in a search
performed by the user. When displaying the results, the program will output one element of
the array at a time. This may be done for a specified number of values or until all the values
stored in the array have been output. While the program could create a new variable for each
result found, storing the results in an array is much more efficient way to manage memory.
The syntax for storing and displaying the values in an array typically looks something like
this:
arrayname[0] = "This ";
Java array is an object which contains elements of a similar data type. Additionally, The
elements of an array are stored in a contiguous memory location. It is a data structure where
we store similar elements. We can store only a fixed set of elements in a Java array.
Array in Java is index-based, the first element of the array is stored at the 0th index, 2nd
In Java, array is an object of a dynamically generated class. Java array inherits the Object
class, and implements the Serializable as well as Closeable interfaces. We can store primitive
values or objects in an array in Java. Like C/C++, we can also create single dimensional or
multidimensional arrays in Java.
Moreover, Java provides the feature of anonymous arrays which is not available in C/C++
Advantages
Code Optimization: It makes the code optimized, we can retrieve or sort the data efficiently.
Random access: We can get any data located at an index position.
Disadvantages
Size Limit: We can store only the fixed size of elements in the array. It doesn't grow its size
at runtime. To solve this problem, collection framework is used in Java which grows
automatically.
Q-5. Define the Operator Precedence with hierarchy.
Operator precedence determines the grouping of terms in an expression and decides how an
expression is evaluated. Certain operators have higher precedence than others; for example,
the multiplication operator has a higher precedence than the addition operator.
For example, x = 7 + 3 * 2; here, x is assigned 13, not 20 because operator * has a higher
precedence than +, so it first gets multiplied with 3*2 and then adds into 7.
Here, operators with the highest precedence appear at the top of the table, those with the
lowest appear at the bottom. Within an expression, higher precedence operators will be
evaluated first.
java has well-defined rules for specifying the order in which the operators in an expression
are evaluated when the expression has several operators. For example, multiplication and
division have a higher precedence than addition and subtraction. Precedence rules can be
overridden by explicit parentheses.
Precedence order.
When two operators share an operand the operator with the higher precedence goes first. For
example, 1 + 2 * 3 is treated as 1 + (2 * 3), whereas 1 * 2 + 3 is treated as (1 * 2) + 3 since
multiplication has a higher precedence than addition.
Associativity.
When an expression has two operators with the same precedence, the expression is evaluated
according to its associativity. For example x = y = z = 17 is treated as x = (y = (z = 17)),
leaving all three variables with the value 17, since the = operator has right-to-left associatively (and
an assignment statement evaluates to the value on the right hand side). On the other hand, 72 / 2
/ 3 is treated as (72 / 2) / 3 since the / operator has left-to-right associatively. Some operators
are not associative: for example, the expressions (x <= y <= z) and x++-- are invalid.
Precedence and associatively of Java operators.
The table below shows all Java operators from highest to lowest precedence, along with their
associatively. Most programmers do not memorize them all, and even those that do still use
parentheses for clarity.
Order of evaluation of subexpressions.
Associativity and precedence determine in which order Java applies operators to subexpressions but
they do not determine in which order the subexpressions are evaluated. In Java, subexpressions are
evaluated from left to right (when there is a choice). So, for example in the expression A() + B()
* C(D(), E()), the subexpressions are evaluated in the order A(), B(), D(), E(), and C().
Although, C() appears to the left of both D() and E(), we need the results of both D() and E() to
evaluate C(). It is considered poor style to write code that relies upon this behavior (and different
programming languages may use different rules).
Short circuiting. When using the conditional and and or operators (&& and ||), Java does not
evaluate the second operand unless it is necessary to resolve the result. This allows
statements like if (s != null && s.length() < 10) to work reliably. Programmers
rarely use the non short-circuiting versions (& and |) with boolean expressions.
Precedence order gone awry.
Sometimes the precedence order defined in a language do not conform with mathematical norms.
For example, in Microsoft Excel, -a^b is interpreted as (-a)^b instead of -(a^b). So -1^2 is equal to 1
instead of -1, which is the values most mathematicians would expect. Microsoft acknowledges this
quirk as a “design choice.” One wonders whether the programmer was relying on the C precedence
order in which unary operators have higher precedence than binary operators. This rule agrees with
mathematical conventions for all C operators, but fails with the addition of the exponentiation
operator. Once the order was established in Microsoft Excel 2.0, it could not easily be changed
without breaking backward compatibility.