Friday, July 24, 2020

Wrapper Classes in Java Programming (Boxing and Unboxing)

Wrapper Class:
    A Wrapper class is a class whose object wraps or contains a primitive data types. We can wrap a primitive value into a wrapper class object. We can also convert a wrapper object to the primitive data type.

Why and When need of wrapper classes ?
  
1. The classes in java.util package handles only objects and hence wrapper classes help in this case also. When we use Generics of Collection Framework, such as LinkedList, ArrayList, Vector, etc. we have to use Wrapper classes and not primitive types.

for ex.
    ArrayList<Integer> obj = new ArrayList<Integer>();
   
   here, we can not use int primitive data type we have to use Integer wrapper class.

2. When we use any web based form then there we use String for numbers but we have to convert that numbers into the integer format then we use wrapper class there.

for ex.
    String s = "+919898989898";
   
    int i = Integer.parseInt(s);
    suppose above number is an contact number but it is in string type we have to convert it into int type then we can convert it using Integer wrapper class.
   
3. An object is needed to support synchronization in multithreading.

Wrapper Classes List:


  • Boxing : conversion of primitive types to the object.
    for ex.
             int a = 10;
            Integer obj = new Integer(a);    // 1st way for conversion
             Integer obj2 =Integer.valueOf(a);    //2nd way for conversion

  • AutoBoxing : Automatic conversion of primitive types to the object.
      for ex.
             int a = 10;
             Integer obj3 = a;   //way for conversion
  • Unboxing : converting an object of a wrapper class to its corresponding primitive type is known as unboxing.
        for ex.
        Integer obj = 500;
        int u = obj.intValue();
  • AutoUnboxing : Automatic converting an object of a wrapper class to its corresponding primitive type is known as AutoUnboxing.
         for ex.
        Integer obj = 500;
        int u1= obj;


For better Explanation Watch the video.......

Tuesday, July 14, 2020

Troubleshooting and the Future of Networking | Quiz with Answers





data resilience 

Answer - error detection 

Explanation - Error detection is determining that an error occurred; error recovery is attempting to fix this error automatically.

2.



DNS 

Answer - Server

Explanation - Issuing a server keyword, followed by a DNS server, will change what server you're using for resolution attempts.

3.


0000:0000:0000:0000:0000:0000:0000:0001  

Answer -   0000:0000:0000:0000:0000:0000:0000:0001   

Explanation - The IPv6 loopback address is a great example of how IPv6 address compaction works.

4.



Platform as a Schedule 

Answer -  Platform as a Service

Explanation - PaaS enables you to run applications without requiring an entire server to do so.

5.



flow label 

Answer - hop limit

Explanation - The hop limit field corresponds to the IPv4 TTL field.

6.
Windows 7 
Answer - Mac OS and Linux
Explanation - On Linux and macOS, traceroute sends UDP packets to very high port numbers. 
7.
Echo request 
Answer - Anycast
Explanation - Anycast is a method that pools servers to provide services as if it were a single system.
8.
127.0.0.1  
Answer - 127.0.0.1
Explanation - A loopback address points to itself and is used for troubleshooting purposes.
9.
64
Answer - 128
Explanation - IPv6 addresses are 128 bits compared to 32 bits of an IPv4 IP address.
10.
Next header 
Answer - Flow label
Explanation - The flow label field is used in conjunction with the traffic class field for routers, to make decisions about the quality of service level for a specific datagram.
11.
8 groups of 16 bits  
Answer - 8 groups of 16 bits
Explanation - IPv6 addresses are usually written out as 8 groups of 16 bits each. Each of these groups is further made up of 4 hexadecimal digits.
12.
Datagrams  
Answer - IPV6 tunnels
Explanation - An IPv6 tunnel is used to encapsulate data between IPv6 tunnel servers.

13.
32-bit 
Answer - 16-bit
Explanation - The payload length field is a 16-bit field that defines how long the data payload section of the datagram is. 

14.



Internet Control Mail Protocol 

Answer -  Internet Control Message Protocol

Explanation - ICMP is used to deliver messages about network errors. 

15.


8.8.4.4  

Answer - 8.8.4.4

Explanation - 8.8.8.8 and 8.8.4.4 are useful IPs to memorize when troubleshooting. 

16.



government  

Answer - DNS registrar

Explanation - You can use a registrar to register a domain name! 

17.



link local unicast  

Answer - link local unicast 

Explanation - Link-local unicast is used for IPv6 nodes to get their network configuration, much like DHCP.

18.
128

Answer - 80
Explanation - 80 zeroes, followed by 16 ones, followed by the IPv4 address itself it how the IPv4 mapped address space works.

 19.



nslookup 

Answer - nslookup

 Explanation - Using the nslookup command with a domain will return a host (A) record.

20.



-Port 

Answer -  -v 

 Explanation - The “-v” flag, which stands for verbose, is useful as it formats the command’s output to be readable to human eyes.

 21.
Community 

Answer - Hybrid

Explanation - A combination of cloud delivery models make up a hybrid type of deployment. In this case, both private and public models are being used.

22.
nslookup 
Answer - mtr and pathping 
Explanation - The mtr command works in real time and will continually update its output with all of the current aggregate data. Pathping runs for 50 seconds and then displays the final aggregate data all at once. 
 23.
Removing all leading ones. 
Answer - Removing all leading zeros and Replace groups of zeros with colons.
Explanation - When shortening an IPv6 address, you can remove any leading zeros from a group. Any number of consecutive groups composed of just zeroes can be replaced with two colons.

24.



0000:0000:0000:0000:0000:0000:0000:0001 

Answer -  2001:db8::ff00:12:3456

Explanation - IPv6 address compaction is a great way to shorten IPv6 addresses. 

25.



Echo reply  

Answer - ICMP

Explanation - The ping utility uses the Internet Control Message Protocol (ICMP). 

26.



12  

Answer - 4

Explanation - Linux and Mac systems send echo requests until the ping command is stopped. A Windows system sends only 4 echo requests by default.

 27.
Destination port unreachable 
 
Answer - 

Happy Birthday Priya Using Python Turtle Graphics

Happy Birthday Priya Using Python Turtle Graphics.... import  turtle  as  tech_habit from turtle import * from random import randint ankita ...