0% found this document useful (0 votes)
4 views3 pages

REVISION QUESTIONS JAVA

The document covers various topics related to network programming in Java, including definitions of key terms, differences between ServerSocket and Socket, exception handling, and serialization. It includes code examples for server applications, multi-threaded servers, and client applications, as well as discussions on threading, URL handling, and network connection tools. Additionally, it addresses the OSI and TCP models, the importance of streams, and the concept of persistent objects.

Uploaded by

Antonate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

REVISION QUESTIONS JAVA

The document covers various topics related to network programming in Java, including definitions of key terms, differences between ServerSocket and Socket, exception handling, and serialization. It includes code examples for server applications, multi-threaded servers, and client applications, as well as discussions on threading, URL handling, and network connection tools. Additionally, it addresses the OSI and TCP models, the importance of streams, and the concept of persistent objects.

Uploaded by

Antonate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

a) Define the term port as it applies to network programming.

b) What is the difference between a ServerSocket and a Socket?


c) In which Java package is the ServerSocket and Socket defined?
d) Write code for Server application, that is supposed to be listening for http requests on
port 2020 and sends a message, "Welcome to the 2013 November Exam" to client
when a socket is created. Do not write code for the client program

a) Discuss exception handling and two categories of exception class provided by Java
programming language
b) Describe the three main components of Java and its features
c) Identify five network applications developed using Java programming language

a. With an aid of diagrams describe the differences between the OSI model and
the TCP model
b. Analyse how the communication takes place between layers of the OSI model

a. What do you understand by serialization of java object?


b. Define a stream as it is used in Java.
c. Create a serializable Class called BankAccount with the following fields account
name, account number, account type and balance. You should provide getters
and setters for the variables you define and a method called saveToFile ( ) that
persists the calling object to a file called bankaccounts.dat

a. Based on the IPv4 model, describe all the parts and usage of each part in the IPv4
model structure
b. Write a program that can display 32 bit IP address and user domain name in the WAN
network
a. What do you understand by persistence of a java object.

b. Write a code excerpt to demonstrate how you would persist an object.

Write code for a multi-threaded server that would echo system time to a telnet client on port
23
c. Why is stream concept essential for network programming
d. Describe two stream types and their stream family
e. Use the URL class and the openStream () method to read data exposed from
the following endpoint www.maps.com. Insert line comments on each line to
explain your code.

c. Write code for client application that is supposed to hack into to a remote server listening
for messages on port 2019 and download a file called secret.txt. Assume that the file is
streamed by the server upon connection.

a. Explain the concept of threading and multithreading


b. Describe five methods provided by Java to control threads
c. Build a SimpleSleepThread class by implementing Runnable. Create an object Thread
and start the thread. In run method, let the threadsleep for 50000ms. Display strings
before and after the threadsleep. Is there any noticeable time difference between the
two strings displayed? Why orwhy not?

a) Define UnknownHostException.
b) In which package do we find InetAddress. Comment on how we can create objects of
this class
c) Write a Java program that retrieves the ip address of a local computer
d) Write a Java program that retrieves the ip address of a remote computer
a. Describe five methods provided by Java to control threads
b. Develop threading application by using java.Lang.Thread class and implement
java.lang.Runnable
c. What do you understand about communication between threads? Explain how pipe
communication and waiting thread notification can be implemented.
a. Differentiate the three URL classes in Java
b. Explain the concept of URL and its formats
a. Write a program to create, read and write information from client to server using
URLConnection class
b. Explain the concept of a layered task with respect to the TCP model.
c. Explain in your own words, your understanding of persistent objects and serialised
Objects.

a. Why are threads important in network programming?


. Explain the following various types of sockets

i. Stream socket (TCP)


ii. Datagram socket (UDP)
iii. Raw socket

a. Write a Java program that retrieves the IP address of a local computer


a. Analyse the tools used in developing Java application
b. How many layers are there in TCP model? Explain the functions of each of the TCP
layers
a. Explain filter stream and identify the different types
b. What does persistent object mean and where should such objects be stored
c. State and explain any 6 network connection tools
a) Write a short note on serialization in Java
b) The JavaBean specification requires a class to be serializable and JavaBean class
must have a no-arg constructor. All JavaBean properties must have public setter and
getter methods. All JavaBean instance variables should be private.
Write a JavaBean class for a StudentAccount class with the following variables, name
and id.

You might also like