Write the required lines of code

Assignment Help Programming Languages
Reference no: EM13804617

Question 1. Write the listenSocket method (server-side program).

a - Write the required lines of code that will create a ServerSocket object with a port number 3421 on which the server program is going to listen for client communications.

b- Write the required lines of code that will create a new socket object.

c - Write the required lines of code that will read the data sent over the socket connection from the client program.

Question 2. Write the listenSocket method (client-side program) with the hostname mydevry2 and port number 2431. Write it to send the data over the socket connection to the server and read the text sent by the server back to the client. (Points : 30)

Question 3. Complete the following Java Applet program that will check whether the input value (integer) is even or odd.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class CheckInput {

JLabelresultLbl;
JLabelinputLbl;
JTextFieldinputTxt;
JButton check;

public void init() {
JPanel panel = new JPanel(new GridLayout(4,2));
panel.add(new JLabel("Input:"));
inputTxt = new JTextField();
panel.add(inputTxt);
panel.add(new JLabel("Result:"));
resultLbl = new JLabel();
panel.add(resultLbl);
check = new JButton("Check");
panel.add(check);
check.addActionListener(this);
getContentPane().add(panel);
}
public void actionPerformed(ActionEvent arg0) {
}
}

Question 4.

a - Create a new cookie with the following information:

Name: userEmail
Value: [email protected]

b - Add the above cookie to the response header.

c - Retrieve the value of the above cookie from the list of all available cookies. (Points : 30)

Question 5. Write a program that will create two threads and will print out the following information:
o Thread 1:
M
N
o Thread 2:
P
R

Reference no: EM13804617

Questions Cloud

Write about effect of moderate alcohol consumption on fetuin : Write a research paper about "Effect of moderate alcohol consumption on fetuin-A levels in men and women: post-hoc analyses of three open-label randomized crossover trials".
Weight training program : Your task is to design your own weightlifting program using all the information and resources that are provided in this chapter for you. By following all the steps you will design a program that is especially designed for you.
Discuss about managing priorities : Managing Priorities
Different kinds of organisation and different country contex : Understand key contemporary labour market trends and their significance for different kinds of organisation and in different country contexts.
Write the required lines of code : Write the required lines of code that will create a ServerSocket object with a port number 3421 on which the server program is going to listen for client communications. Write the required lines of code that will create a new socket object
About communication channels : Communication Channels
Assignment on technology issues : Technology Issues
How can she increase the number of files : A Microsoft Word user noticed that another user in her department has more than four files listed in the recently used files list in the Files pull-down menu. How can she increase the number of files listed on her computer
Technology in online learning : Technology in Online Learning

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd