Você está na página 1de 5

Swaping two variables with out third

int a, b;

printf("\nEnter value for num1 & num2 : ";
s!anf(""d "d", &a, &b;

a # a $ b;
b # a % b;
a # a % b;
JVM
JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides
runtime environment in which java bytecode can be executed.
JVMs are available for many hardware and software platforms. JVM, J! and J"# are
platform dependent because confi$uration of each %& differs. 'ut, Java is platform
independent.
(he JVM performs followin$ main tas)s*
+oads code
Verifies code
!xecutes code
,rovides runtime environment
JRE
J! is an acronym for Java untime !nvironment.It is used to provide runtime
environment.It is the implementation of JVM.It physically exists.It contains set of libraries
- other files that JVM uses at runtime.
Implementation of JVMs are also actively released by other companies besides &un Micro
&ystems.
JDK
J"# is an acronym for Java "evelopment #it.It physically exists.It contains J! -
development tools.
If a class have an entity reference, it is )nown as .$$re$ation. .$$re$ation represents /.&0
. relationship.
1onsider a situation, !mployee object contains many informations such as id, name, emailId
etc. It contains one more object named address, which contains its own informations such
as city, state, country, 2ipcode etc. as $iven below.
1. class !mployee3
2. int id4
3. &trin$ name4
4. .ddress address455.ddress is a class
5. ...
6. 6
In such case, !mployee has an entity reference address, so relationship is !mployee /.&0.
address.
Why use Aggregation?
7or 1ode eusability.
(Q) What is OSI Model ?
Ans :- Check my article The OSI Models Seven Layers Defined and Fnctions !"#lained
(Q) What is TCP ?
Ans :- Check my article $hat is Transmission Control %rotocol &TC% '
(Q) What is differences between TCP and UDP ?
Ans :- Check my article $hat is differences (et)een TC% and *D%
(Q) Which layer is resonsible for con!ertin" data ac#ets fro$ the Data
%in# layer into electrical si"nals ?
Ans :- Physical %ayer
!"#lanation :- The %hysical layer takes frames from the Data Link Layer and encodes
the +s and ,s into a di-ital si-nal for transmission on the net)ork medim.
(Q) &t which layer is ro'tin" i$le$ented( enablin" connections and ath
selection between two end syste$s) ?
Ans :- *etwor# %ayer
!"#lanation :- The /et)ork layer #rovides rotin- thro-h an inter-net)ork and lo-ical
addressin-.
(Q) Which layer defines how data is for$atted( resented( encoded(and
con!erted for 'se on the networ# ?
Ans :- Presentation %ayer
!"#lanation :- The %resentation layer makes sre that data is in reada(le format for the
a##lication layer.
(Q) Which layer is resonsible for creatin"( $ana"in" and ter$inatin"
sessions between alications ?
Ans :- Session
!"#lanation :- The Session layer set#0 maintains0 and terminates session (et)een
a##lications.
(Q) Which layer ro!ides lo"ical addressin" that ro'ters will 'se for ath
deter$ination ?
Ans :- *etwor# %ayer
!"#lanation :- The /et)ork layer #rovides lo-ical addressin-0 ty#ically I% addressin-
and rotin-.
(Q) Which layer secifies !olta"e( wire seed( and ino't cables and $o!es
bits between de!ices ?
Ans :- Physical %ayer
!"#lanation :- The %hysical layer is res#onsi(le for the electrical and mechanical
connections (et)een devices.
(Q) Which layer co$bines bits into bytes and bytes into fra$es( 'ses M&C
addressin"( and ro!ide error detection ?
Ans :- Data %in# %ayer
!"#lanation :- The Data-link layer is res#onsi(le for the framin- of data #ackets.
&Q) Which layer is resonsible for #eein" the data fro$ different
alications searate on the networ# ?
Ans :- Session layer
!"#lanation :- The Session layer creates sessions (et)een different host a##lications.
&Q) Which layer se"$ents and rese$bles data into a data strea$ ?
Ans :- Trans#ort
(Q) Which layer ro!ides the hysical trans$ission of the data and
handless error notification( networ# toolo"y( and flow control ?
Ans :- Data Link Layer
(Q) Which %ayer $ana"es de!ice addressin"( trac#s the location of de!ices
on the networ#( and deter$ine the best way to $o!e data ?
Ans :- /et)ork layer
(Q) +ow Data brea#s down on each layer fro$ to to botto$ ?

&Q) What is Data ,ncas'lation 1 or Order of !nca#slation 1 or $hich layer is
re#resented (y frames 1 $hich layer is re#resented (y se-ments 1 $hich layer is
re#resented (y %ackets 1 $hich Layer is re#resented (y (its 1
Ans :- Data enca#slation is the #rocess that takes #lace )hen one host on a net)ork
needs to send data to another host. As data is #re#ared for transit0 it flo)s do)n thro-h
each layer of the OSI model. At each layer0 e"tra control information is added to the data
(efore (ein- #assed to the layer (elo). This #rocess contines ntil the data reaches the
#hysical layer )here the data is #assed onto the net)ork medim as a series of ,2s and
+2s.
&Q) D*S 'ses which rotocol? Why?
D/S is sin- (oth TC% and *D% #rotocol. TCP for -one e.cahn"es (et)een server
and UDP )hen a clients is tryin- to resol!e a hostna$e to an IP/address.
(Q) What are the differences between OSI and TCP0IP $odel?
OSI is a reference model and TC%3I% is an im#lementation of OSI model.
OSI has 4 layers )hereas TC%3I% has only 5 layers The ##er 6 layers of the OSI
model is com(ined on the TC%3I% model.
OSI has: #hysical layer0 data link layer0 net)ork layer0 trans#ort layer0 session
layer0 #resentation layer and a##lication layer TC%3I% has : /et)ork layer0 Internet
layer0 trans#ort layer and a##lication layer.
&Q) M&C address wor#s on which layer ? What are the differences of M&C
s'blayer and %%C s'blayer?
Ans :- MAC address )orks on data/lin# layer.
M&C s'blayer(123)4)5/ defines ho) to transmit data on #hysical layer
%%C s'blayer(123)3)5/ res#onsi(le for identifyin- different #rotocol lo-ically 7
enca#slate them.

Você também pode gostar