From b24c3f41fba510e982a0e2ca83b9afcdf38f4b19 Mon Sep 17 00:00:00 2001 From: Khushi2402 <99236177+Khushi2402@users.noreply.github.com> Date: Tue, 8 Feb 2022 10:16:32 +0530 Subject: [PATCH 1/4] FirstUI.java --- FirstUI.java | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 FirstUI.java diff --git a/FirstUI.java b/FirstUI.java new file mode 100644 index 0000000..835b32c --- /dev/null +++ b/FirstUI.java @@ -0,0 +1,67 @@ +import java.awt.*; +import java.awt.event.*; +class FirstUI extends Frame implements WindowListener, ActionListener +{ + Button b1; + GridLayout g1; + Label l1, l2; + TextField tf; + FirstUI() + { + setTitle("First UI Interface WIndow"); + setSize(500,500); + g1=new GridLayout(2,2); //2 rows 2 columns + setLayout(g1); + l1=new Label("Enter your name"); + add(l1); + tf=new TextField(); + add(tf); + b1=new Button("OK"); + add(b1); + l2=new Label(); + add(l2); + b1.addActionListener(this); //this means the window + addWindowListener(this); //to connect FirstUI to WindowListener + show(); + } + public void actionPerformed(ActionEvent e1) + { + System.out.println("You clicked on the button"); + String str=tf.getText(); + l2.setText(str); + System.out.println(str); + } + public static void main(String args[]) + { + FirstUI f=new FirstUI(); + } + public void windowDeactivated(WindowEvent e) + { + System.out.println("Window Deactivated"); + } + public void windowActivated(WindowEvent e) + { + System.out.println("Window Activated"); + } + public void windowDeiconified(WindowEvent e) + { + System.out.println("Window Deiconified"); + } + public void windowIconified(WindowEvent e) + { + System.out.println("Window Iconified"); + } + public void windowOpened(WindowEvent e) + { + System.out.println("Window Opened"); + } + public void windowClosed(WindowEvent e) + { + System.out.println("Window Closed"); + } + public void windowClosing(WindowEvent e) + { + System.out.println("Window Closing"); + System.exit(0); + } +} \ No newline at end of file From fc08662952bddf3fcb14126179455729ea25b62d Mon Sep 17 00:00:00 2001 From: Khushi2402 <99236177+Khushi2402@users.noreply.github.com> Date: Wed, 9 Feb 2022 18:44:05 +0530 Subject: [PATCH 2/4] FactClient.java --- factClient.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 factClient.java diff --git a/factClient.java b/factClient.java new file mode 100644 index 0000000..7cbfc46 --- /dev/null +++ b/factClient.java @@ -0,0 +1,24 @@ + import java.io.*; +import java.net.*; +class factclient{ + public static void main(String argv[]) throws Exception + { + String n; + DatagramSocket clientSocket = new DatagramSocket(); + byte []send=new byte[102]; + byte []resive=new byte[102]; + BufferedReader inFromUser = new BufferedReader(new + InputStreamReader(System.in)); + System.out.println("\nEnter Number : "); + n=inFromUser.readLine(); + InetAddress ipadd= InetAddress.getByName("localhost"); + send=n.getBytes(); + DatagramPacketsendPck=new DatagramPacket(send,send.length,ipadd,6870); + clientSocket.send(sendPck); + DatagramPacket resPck=new DatagramPacket(resive,resive.length); + clientSocket.receive(resPck); + String fact=new String(resPck.getData()); + System.out.println("FROM SERVER: " +n+"! = " +fact); + clientSocket.close(); + } +} \ No newline at end of file From 97a6e7b300e663ebfb7ac9014e4eb3577465c90b Mon Sep 17 00:00:00 2001 From: Khushi2402 <99236177+Khushi2402@users.noreply.github.com> Date: Tue, 22 Feb 2022 09:40:42 +0530 Subject: [PATCH 3/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0e8605c..59bd902 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # 2feb2022 Demo for bca bscit sem 4 +This is the first git jenkins demo From 89b8af459785f8278346abad9f73330c8e47c880 Mon Sep 17 00:00:00 2001 From: Khushi2402 <99236177+Khushi2402@users.noreply.github.com> Date: Wed, 2 Mar 2022 13:53:59 +0530 Subject: [PATCH 4/4] Sort.java --- Sort.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Sort.java diff --git a/Sort.java b/Sort.java new file mode 100644 index 0000000..fa3b9ce --- /dev/null +++ b/Sort.java @@ -0,0 +1,11 @@ +import java.util.Arrays; +public class Sort{ + public static void main(String args[]){ + int array[] = {97, 10, 85, 20, 25, 85, 63, 96, 57, 1}; + int size = array.length; + Arrays.sort(array); + System.out.println("sorted Array ::"+Arrays.toString(array)); + int res = array[size-1]; + System.out.println("largest element is ::"+res); + } +} \ No newline at end of file