Friday 21 June 2013

JAVA MCQ EXERCISE


HEY FRIENDS ......
                            Try to answer  ..................... 



1.  Which four options describe the correct default values for array elements of the types indicated?
  1. int -> 0
  2. String -> "null"
  3. Dog -> null
  4. char -> '\u0000'
  5. float -> 0.0f
  6. boolean -> true
A. 1, 2, 3, 4B. 1, 3, 4, 5
C. 2, 4, 5, 6D. 3, 4, 5, 6



Q.2  Which one of these lists contains only Java programming language keywords?
A. class, if, void, long, Int, continue
B. goto, instanceof, native, finally, default, throws
C. try, virtual, throw, final, volatile, transient
D. strictfp, constant, super, implements, do
E. byte, break, assert, switch, include




Q.3)  Which is a reserved word in the Java programming language?
A. methodB. native
C. subclassesD. reference
E. array

Q.4) Which three are legal array declarations?
  1. int [] myScores [];
  2. char [] myChars;
  3. int [6] myScores;
  4. Dog myDogs [];
  5. Dog myDogs [7];
A. 1, 2, 4B. 2, 4, 5
C. 2, 3, 4D. All are correct.


Q.5)  
public interface Foo 
{ 
    int k = 4; /* Line 3 */
}
 
Which three piece of codes are equivalent to line 3?
  1. final int k = 4;
  2. public int k = 4;
  3. static int k = 4;
  4. abstract int k = 4;
  5. volatile int k = 4;
  6. protected int k = 4;   


A . 1, 2  and 3                                    B.   2, 3, 4
C.  3, 4  and 5                                    D.   4, 5, 6


9.  Which three are valid declarations of a char?
  1. char c1 = 064770;
  2. char c2 = 'face';
  3. char c3 = 0xbeef;
  4. char c4 = \u0022;
  5. char c5 = '\iface';
  6. char c6 = '\uface';
A. 1, 2, 4
B. 1, 3, 6
C. 3, 5
D. 5 only


10.   Which is the valid declarations within an interface definition?
A. public double methoda();
B. public final double methoda();
C. static void methoda(double d1);
D. protected void methoda(double d1);




 
 
 

Thursday 20 June 2013

Objective Question for Java Lovers

Short Java Questions


Q.1 ) JAR stand for -------

-->         Java Archive

 

Q.2)  Command which is used to see the details of compilation --

-->       Javac -verbose  Test.java

Q.3)  Select the keywords in java :

a) Assert            Keyword

b) transient       Keyword 

c) Script fp        Keyword      

d) instance of    Keyword   

e) finalize          Not Keyword


Q.4)  //   /* Nesting of comment  */    is it true in Java ?

--->   True.


Q.5)   Can we run the same java program on different enviroment  with same version of JDK ?

--->  No


Q.6) The compiler and other java development tool reside in  -----------  sub folder ?

--->   bin


Q.7) The library containing files needed to integrate java programs written in other languages reside inside following sub folder ------- ?

--->    include

 

Q.8) Java has ----  no. of primitive data types ?

-->   8   such as  byte,   short, int, long, char, float, double, boolean.

 


    


Virtual - Circuit - Switching

VIRTUAL - CIRCUIT - SWITCHING


 Virtual circuit switching is a combination of  Datagram switching and Circuit Switching. 

This type of switching includes some features of Datagram switching and some of Circuit Switching, I will try to explain u with a figure :

 

DATAGRAM                 Virtual-Circuit                  Circuit-Switching

         |                                     |                                              |

Network Layer             Data Link Layer                Physical Layer

Resource allocation             -------                       Resource allocation

Packetization                                                       Three Phases

 

Addressing  in Virtual - Circuit Switching :

 In the header section of Packet is local jurisdiction, not the end- to end jurisdiction.

There are 2 type of addresses used in Virtual Circuit Switching :

Global and Local address(VCI)

  Global Address : Source or destination needs to have a global add., a address that can be unique in the scope of the whole Network

Global address in VCN is used only to create VCI.

VCI ( Virtual Circuit Identifier ) : actually used for data transfer, a small number that has only switch scope.

 

 

 

 

 

 

Sunday 16 June 2013

Circuit Switching

Circuit Switching


Circuit Switching take place in Physical Layer.

In this type 2 network nodes establish a dedicated communication channel through the network before the nodes may communicate.

The  circuit guarantees the full bandwidth of the channel and remain connected for the duration of the communication session. The circuit function as if the nodes were physically connected .

In circuit switching a bit delay is constant.

There is no addressing involved during data transfer. The switches route the data based on their banwidth (FDM) or time slot (TDM) , Of course  end to end addressing used during set up phase. 

Three phases of circuit switching are:

  1.  Set-up phaseConnection is established between end points  before any communication. First end send the connection request and the second end send the acknowledgement in this phase.

  2.  Data Transfer Phase In this phase communication take place.

  3.  Tear-down phase : when one of the parties want to disconnect a signal is sent to each switch to leave the resources.

    EFFICIENCY :  This type of switching is not efficient.

    Delay But delay is minimal. There is no waiting time at each switch. Total delay is due to time needed to create connection, transfer data and  and disconnect circuit.

    Uses :

    Plain old telephone system (POTS) uses circuit switching.

    Original GSM is also based on circuit switching. But GPRS introduce packet switching in GSM network.






Search This Blog

Total Pageviews