F.What is multicasting or multicast transmission? Which Protocol is generally us
ID: 3820395 • Letter: F
Question
F.What is multicasting or multicast transmission? Which Protocol is generally used for multicast? TCP or UDP?
G.Write the missing Code?
import java.______;
import java.______;
class Whois {
public static void main(String args[]) throws Exception {
int c;
// Create a socket connected to internic.net, port 43.
Socket s = new Socket("internic.net", 43);
InputStream in = _____ getInputStream();
OutputStream out = s.getOutputStream();
// Construct a request string.
String str = (args.length == 0 ? "osborne.com" : args[0]) + " ";
byte buf[] = str._________(); // Convert to bytes.
out.write(buf); // Send request
// Read and display response.
while ((c = in.read()) != -1) {
System.out.print((char) c); }
s.close(); } }
H.How to implement an applet into a web page using applet tag?
I.Explain how to implement an applet into a web page using applet tag?
J.How to implement an applet into a Java program?
K.Explain how to set the background color within the applet area?
L.What are the methods that control an applet’s on-screen appearance?
M.Explain how to play sound in an applet?
N.Write the missing code in the following applet.
import java.awt.*;
import java.applet.*;
public class SimpleApplet ________________ {
public void paint(Graphics g) {
_______drawString("A Simple Applet", 20, 20); } }
Explanation / Answer
F.UDP is used for multicast/
Multicast is a one-to-many communication .
G.
/* package whatever; // don't place package name! */
import java.io.*;
import java.net.*;
class Whois {
public static void main(String args[]) throws Exception {
int c;
// Create a socket connected to internic.net, port 43.
Socket s = new Socket("internic.net", 43);
InputStream in = s.getInputStream();
OutputStream out = s.getOutputStream();
// Construct a request string.
String str = (args.length == 0 ? "osborne.com" : args[0]) + " ";
byte buf[] = str.getBytes(); // Convert to bytes.
out.write(buf); // Send request
// Read and display response.
while ((c = in.read()) != -1) {
System.out.print((char) c); }
s.close(); } }
H
<APPLET CODE="FILENAME.class" WIDTH=100 HEIGHT=100>
</APPLET>
I.
First write the applet program save as .java compile to generate the .class file then place the filename of class file in the CODE=<" "> portion and save ur .html /web page and ope in java enabled browser.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.