https://github.com/dmlloyd/openjdk
In brief, write details of what the user is going to learn in a bullet list.
Choose one of the following options:
okay, on this occasion I will make an app BOT MESSAGE, this is an application that can reply to chat automatically, this application is already widely used by large companies such as Apple smartphone is SIRI feature that can answer the questions from users, google also apply this method to the * oke google* feature, as well as some other apps. we will create two programs that work for questions and answers.
package BotMessage;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import javax.swing.JOptionPane;
public class question {
public static void main(String[] args)throws IOException {
int Port =Integer.parseInt(JOptionPane.showInputDialog("Input Your Port : "));
String IP = JOptionPane.showInputDialog("Input Your IP Server : ");
Socket sock=new Socket("localhost", 6066);
DataInputStream in= new DataInputStream(sock.getInputStream());
System.out.println(in.readUTF());
DataOutputStream out =new DataOutputStream(sock.getOutputStream());
out.writeUTF("please tell me location");
sock.close();
}}
package BotMessage; This is the declaration of the package name we created earlier.import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;import java.net.Socket; this is for declaration of socket programming method.import javax.swing.JOptionPane; this we use because we create the input box with JOptionPane.public class question { this is the declaration of the class name.public static void main(String[] args)throws IOExceptionthis is the main function that must exist in any java programming.int Port =Integer.parseInt(JOptionPane.showInputDialog("Input Your Port : ")); this is the process of creating a new variable that is a port variable, with the fileld input of your port. This port variable serves to create a connection between the two programs.String IP = JOptionPane.showInputDialog("Input Your IP Server : "); this is the process of making a variable with the name of the IP type data string that serves to input IP procces.Socket sock=new Socket("localhost", 6066); this is the process of determining the port and IP, for the port is 6066 and for the IP is localhost .DataOutputStream out =new DataOutputStream(sock.getOutputStream());
out.writeUTF("how are you...?");
sock.close(); this works to end all processes.package BotMessage;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import javax.swing.JOptionPane;
public class answer {
public static void main(String[] args) throws IOException{
int Port =Integer.parseInt(JOptionPane.showInputDialog("Input Your Port : "));
String IP = JOptionPane.showInputDialog("Input Your IP Server : ");
ServerSocket serverSock=new ServerSocket(6066);
Socket Sock=serverSock .accept();
DataOutputStream out =new DataOutputStream(Sock.getOutputStream());
out.writeUTF("i am fine, thank you");
DataInputStream in= new DataInputStream(Sock.getInputStream());
System.out.println(in.readUTF());
Sock.close();
}
}
answer:
THANK YOU
Include a list of related tutorials you have already shared on Utopian that make up a Course Curriculum, if applicable.
https://gist.github.com/andilapulga/08c85909721f70c6e73b21780d9daf61