Question: SECTION A 1. What does the acronym UDP stand for? (5 marks) 2. Name the exception thrown by the Read () method defined in






SECTION A 1. What does the acronym "UDP" stand for? (5 marks) 2. Name the exception thrown by the Read () method defined in OutputStream class? (5 marks) 3. How do servers use the accept () method in ServerSocket class? (5 marks) 4. What is wrong with following interface and give the correct code. (5 marks) public interface AInterface { public void aMethod (int aValue) { System.out.println(" The Interface is displayed "); } } 5. Which class is used to encapsulate IP address and DNS in the java.net package? Activate W Go to Settings (5 marks) 6. What will happen when executing the following fragment of code? int x=0; do { x--; }while(x < 0); (5 marks) 7. How can communication with a web server be implemented without using sockets? (5 marks) 8. What is the output of the following program? import java.net.*; class networking { public static void main(String[] args) throws UnknownHostException { InetAddress obj =InetAddress.getByName("amazon.com"); InetAddress obj2 =InetAddress.getByName("google.com"); boolean x = objl.equals (obj2); } System.out.print (x); } 9. Which method of DatagramPacket is used to find the port number? (5 marks) (5 marks) Acti Go to 10. When is the method flush() required to flush an output stream in Java. Question 11 (5 marks) Explain the difference between a static method and an instance method. What is the difference between an accessor method and a mutator method? (10marks) Question 12 a) Describe advantages and disadvantages of using the Threaded Programming Model for networking applications. b) Given the following code: public class DMV implements Runnable { public static void main(String[] args) { DMV d = new DMV0); new Thread(d).start(); Thread t1 new Thread(d); t1.start(); } public void run() { for(int j=0;j
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
