In: Computer Science
Please answer with a fully detailed solution with
examples.
Difference between interpretive and compiler languages?
What are the four pillars of OOP and provide a simple example for
each and code as well?
What is the highest superclass in Java and why and what are the
other ones and explain them as well.
Describe the components involved in the processing of one web
request.
COMPILER-
1. Compiler scans the whole program in one go.
2. As it scans the code in one go, the errors (if any) are shown at the end together.
3. Main advantage of compilers is it’s execution time.
4. It converts the the instructions into systematic code.
INTERPRETIVE-
1.Translates program one statement at a time.
2.Considering it scans code one line at a time, errors are shown line by line.
3.Due to interpreters being slow in executing the object code, it is preferred less.
4.It doesn’t convert the instructions instead it directly works on source language.
ABSTRACTION- Reflection is the way toward uncovering the fundamental subtleties of an element, while overlooking the unimportant subtleties, to decrease the intricacy for the clients.
EX- public
class
Employee
{
private
class class;
private
code code;
private
roll roll;
//on...
}
ENCAPSULATION- Epitome is the way toward packaging information and procedure on the information together in an element.
EX- class
InformationHiding
{
// direct access to
hide data
private
Array =
Array()
public
Array
getItems(){
return
items;
}
INHERITANCE- Legacy is utilized to get another sort from a current kind, consequently building up a parent-kid relationship.
EX- public
class
Employee
{
private
class class;
private
code code;
private
roll roll;
//on...
}
public
class
Manager
extends
Employee {
private
List<Employee> reportees;
}
POLYMORPHISM- Polymorphism lets a substance take on various implications in various settings.
EX- class
Operator
{
int
sum(
int
a,
intb
) {
return
a+ b;
}
double
sum(
double
a,
double
b) {
return
a+ b;
}
String
sum( s1,s2) {
return
s1.concat(s2);
}
}
SUPERCLASS,SUBCLASS AND INHERITANCE-
classes can be gotten from different classes. The inferred class (the class that is gotten from another class) is known as a subclass. The class from which it's inferred is known as the superclass. The accompanying figure outlines these two kinds of classes: actually, in Java, all classes must be gotten from some class. Which prompts the inquiry "Where does everything start?" The top-most class, the class from which all different classes are inferred, is the Object class characterized in java.lang. Article is the foundation of a chain of importance of classes,The subclass acquires state and conduct as factors and techniques from its superclass. The subclass can utilize only the things acquired from its superclass with no guarantees, or the subclass can alter or supersede it. In this way, as you drop down in the pecking order, the classes become increasingly particular:
REQUEST METHOD-
1.The indicator * is utilized when a HTTP demand doesn't have any significant bearing to a specific asset, yet to the worker itself, and is possibly permitted when the strategy utilized doesn't really apply to an asset. For instance:
Choices * HTTP/2.1
2 The absoluteURI is utilized when a HTTP demand is being made to an intermediary. The intermediary is mentioned to advance the solicitation or administration from a substantial reserve, and return the reaction. For instance:
GET http://www.w3.org/bar/WWW/TheProject.html HTTP/2.1
3 The most basic type of Request-URI is that used to distinguish an asset on a source worker or passage. For instance, a customer wishing to recover an asset straightforwardly from the beginning worker would make a TCP association with port 80 of the host "www.w3.org" and send the accompanying lines:
GET/center/WWW/Thepogboom.html HTTP/2.1
Host: www.www4.org
Note that the outright way can't be unfilled; if none is available in the first URI, it MUST be given as "/" (the worker root).