From 78218af02fbdb9f33182a8377a72f8c6748d0707 Mon Sep 17 00:00:00 2001 From: Akash Date: Tue, 26 Mar 2024 23:30:45 +0530 Subject: [PATCH] exp update --- EXPERIMENT1/.classpath | 10 +++ EXPERIMENT1/.project | 17 ++++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 14 ++++ EXPERIMENT1/bin/EXPERIMENT1/Deserial.class | Bin 0 -> 1223 bytes EXPERIMENT1/bin/EXPERIMENT1/Serial.class | Bin 0 -> 1385 bytes EXPERIMENT1/bin/EXPERIMENT1/Student.class | Bin 0 -> 1072 bytes EXPERIMENT1/bin/module-info.class | Bin 0 -> 150 bytes EXPERIMENT1/src/EXPERIMENT1/Deserial.java | 26 ++++++ EXPERIMENT1/src/EXPERIMENT1/Serial.java | 28 +++++++ EXPERIMENT1/src/EXPERIMENT1/Student.java | 18 ++++ EXPERIMENT1/src/module-info.java | 8 ++ EXPERIMENT2/.classpath | 10 +++ EXPERIMENT2/.project | 17 ++++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 14 ++++ .../bin/EXPERIMENT2/AgeComparator.class | Bin 0 -> 667 bytes .../bin/EXPERIMENT2/FeesComparator.class | Bin 0 -> 672 bytes .../bin/EXPERIMENT2/NameComparator.class | Bin 0 -> 688 bytes .../bin/EXPERIMENT2/SalaryComparator.class | Bin 0 -> 678 bytes EXPERIMENT2/bin/EXPERIMENT2/Student.class | Bin 0 -> 1389 bytes EXPERIMENT2/bin/EXPERIMENT2/TEMP1.class | Bin 0 -> 2133 bytes EXPERIMENT2/bin/module-info.class | Bin 0 -> 150 bytes EXPERIMENT2/src/EXPERIMENT2/Student.java | 77 ++++++++++++++++++ EXPERIMENT2/src/EXPERIMENT2/TEMP1.java | 53 ++++++++++++ EXPERIMENT2/src/module-info.java | 8 ++ EXPERIMENT3/.classpath | 11 +++ EXPERIMENT3/.project | 17 ++++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 14 ++++ EXPERIMENT3/bin/jdbc/Temp2.class | Bin 0 -> 3731 bytes EXPERIMENT3/bin/module-info.class | Bin 0 -> 170 bytes EXPERIMENT3/src/jdbc/Temp2.java | 72 ++++++++++++++++ EXPERIMENT3/src/module-info.java | 9 ++ EXPERIMENT4/.classpath | 10 +++ EXPERIMENT4/.project | 17 ++++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 14 ++++ .../bin/lambdaExperession/Student.class | Bin 0 -> 1090 bytes EXPERIMENT4/bin/lambdaExperession/exp4.class | Bin 0 -> 2937 bytes EXPERIMENT4/bin/module-info.class | Bin 0 -> 150 bytes .../src/lambdaExperession/Student.java | 23 ++++++ EXPERIMENT4/src/lambdaExperession/exp4.java | 31 +++++++ EXPERIMENT4/src/module-info.java | 8 ++ labsheets/~$xp1_M1.docx | Bin 162 -> 0 bytes 45 files changed, 534 insertions(+) create mode 100644 EXPERIMENT1/.classpath create mode 100644 EXPERIMENT1/.project create mode 100644 EXPERIMENT1/.settings/org.eclipse.core.resources.prefs create mode 100644 EXPERIMENT1/.settings/org.eclipse.jdt.core.prefs create mode 100644 EXPERIMENT1/bin/EXPERIMENT1/Deserial.class create mode 100644 EXPERIMENT1/bin/EXPERIMENT1/Serial.class create mode 100644 EXPERIMENT1/bin/EXPERIMENT1/Student.class create mode 100644 EXPERIMENT1/bin/module-info.class create mode 100644 EXPERIMENT1/src/EXPERIMENT1/Deserial.java create mode 100644 EXPERIMENT1/src/EXPERIMENT1/Serial.java create mode 100644 EXPERIMENT1/src/EXPERIMENT1/Student.java create mode 100644 EXPERIMENT1/src/module-info.java create mode 100644 EXPERIMENT2/.classpath create mode 100644 EXPERIMENT2/.project create mode 100644 EXPERIMENT2/.settings/org.eclipse.core.resources.prefs create mode 100644 EXPERIMENT2/.settings/org.eclipse.jdt.core.prefs create mode 100644 EXPERIMENT2/bin/EXPERIMENT2/AgeComparator.class create mode 100644 EXPERIMENT2/bin/EXPERIMENT2/FeesComparator.class create mode 100644 EXPERIMENT2/bin/EXPERIMENT2/NameComparator.class create mode 100644 EXPERIMENT2/bin/EXPERIMENT2/SalaryComparator.class create mode 100644 EXPERIMENT2/bin/EXPERIMENT2/Student.class create mode 100644 EXPERIMENT2/bin/EXPERIMENT2/TEMP1.class create mode 100644 EXPERIMENT2/bin/module-info.class create mode 100644 EXPERIMENT2/src/EXPERIMENT2/Student.java create mode 100644 EXPERIMENT2/src/EXPERIMENT2/TEMP1.java create mode 100644 EXPERIMENT2/src/module-info.java create mode 100644 EXPERIMENT3/.classpath create mode 100644 EXPERIMENT3/.project create mode 100644 EXPERIMENT3/.settings/org.eclipse.core.resources.prefs create mode 100644 EXPERIMENT3/.settings/org.eclipse.jdt.core.prefs create mode 100644 EXPERIMENT3/bin/jdbc/Temp2.class create mode 100644 EXPERIMENT3/bin/module-info.class create mode 100644 EXPERIMENT3/src/jdbc/Temp2.java create mode 100644 EXPERIMENT3/src/module-info.java create mode 100644 EXPERIMENT4/.classpath create mode 100644 EXPERIMENT4/.project create mode 100644 EXPERIMENT4/.settings/org.eclipse.core.resources.prefs create mode 100644 EXPERIMENT4/.settings/org.eclipse.jdt.core.prefs create mode 100644 EXPERIMENT4/bin/lambdaExperession/Student.class create mode 100644 EXPERIMENT4/bin/lambdaExperession/exp4.class create mode 100644 EXPERIMENT4/bin/module-info.class create mode 100644 EXPERIMENT4/src/lambdaExperession/Student.java create mode 100644 EXPERIMENT4/src/lambdaExperession/exp4.java create mode 100644 EXPERIMENT4/src/module-info.java delete mode 100644 labsheets/~$xp1_M1.docx diff --git a/EXPERIMENT1/.classpath b/EXPERIMENT1/.classpath new file mode 100644 index 0000000..7a13634 --- /dev/null +++ b/EXPERIMENT1/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/EXPERIMENT1/.project b/EXPERIMENT1/.project new file mode 100644 index 0000000..663011f --- /dev/null +++ b/EXPERIMENT1/.project @@ -0,0 +1,17 @@ + + + EXPERIMENT1 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/EXPERIMENT1/.settings/org.eclipse.core.resources.prefs b/EXPERIMENT1/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/EXPERIMENT1/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/EXPERIMENT1/.settings/org.eclipse.jdt.core.prefs b/EXPERIMENT1/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8c9943d --- /dev/null +++ b/EXPERIMENT1/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/EXPERIMENT1/bin/EXPERIMENT1/Deserial.class b/EXPERIMENT1/bin/EXPERIMENT1/Deserial.class new file mode 100644 index 0000000000000000000000000000000000000000..75eda9652d71b11f4d2e7e20b63d51464da54ad9 GIT binary patch literal 1223 zcmZuwYf}3pY4Or zMen>T)*5I;?`8%pg;C5_m@M#Z0g2QCSH^=Dlp!0 z==J1=Uez{@M%$!cQ)^xX1-#|-{^6W?Vk#Ix*y1)O5RUZ+n-GXNVBI=<;1rDGx&;sw zn6Lquv?qdute~5I+`?@Eg(S*OyF#&ePtLA2Bjb)hu($Gp*)D5_>BBwTmoasv^M%hX zQ>*#$01w&qdYeNCcQHw0haIu&&M1f@A!C}@PBlGlKV~p1AUCWRRrdBuH*99zN|Js& zvS#TnRqHKH#$yMuvkBRglGZTwIw2&rdBiCO`wWRx53LDCE~)-ACJxzU1w=0c{%gGz z(n?w7_UTo}NoKCrymc&C$D)AX#@X$;%9im%1ye13+EN?#5-NpyyIImKVstv2KW8-$ zlVAn>NdOl=t~T#7wIrpmEYs)ko_5>{Ps z7YLjql)J$AUg8{)t(i02_<_m1Ez^>txE;mgDDqd_ojpU0A|lz+ZA*_WWlF}+eZgRk zaS2{eJG?5WAw?b*>sS0aKxPVA1<5o@ZHhI_lKT^~U!{KoqsSwGA|u`-ghPZ;!59p# zd>fHY#ru5AsxXfQN(CRV$oE_fyunjEV+*6$#&e{ZcZ!G^Y7(<7V~LuZu?y7G?BXgC dSfM5pU*_!vQC5q literal 0 HcmV?d00001 diff --git a/EXPERIMENT1/bin/EXPERIMENT1/Serial.class b/EXPERIMENT1/bin/EXPERIMENT1/Serial.class new file mode 100644 index 0000000000000000000000000000000000000000..ed755d321aa995097e557fd5c15825752c3fd7c5 GIT binary patch literal 1385 zcmZuwSx*yD7(KU6d#9x+4r}Yaw=PsrTv~C%qG%~-vD#>2hBCltH#<`mAB>5QCi}e9Qgj`>(Ix0F0s_;S(^@_ovf$CMMI_nW03^ zs@rBsLKEnEY(6s+C9|@Sn3{cT6vm-!70*j- z7wB#abQ^P4#nsWxy6R?GyY>u)37HFAe9ft(;x#Yw7LHC6l!hRf4 zMZ^SpW1DMG-5eE&uCq1Aypb=2IF2iZ69SPI1JiDF;Y^fQB8-z566kndw_R)f!P>Gm zl`a2MVVqV^=ASP$oJGZOCXBP5rdX;vRuJcrl1R4gL2k)$t#TL_Fv?k18(fLrW?L+3 znlIEELrTXb0qHb~MaywQxPmc>t9-ZhPB-|5aZSxf)>L?@qMXN-Zb;(BdW5%x=@&(- z=Gs;6hGy0mxIo?i*$@Gr!!h)>?^bg~xLiJGScy|goK|9lZ1Y|x(LbI1`>KrF`Nz2V zk!TiN_0}ZXYo)C-=bFVQlV+{8{h?g7Q7>9537@O^!wsszU@tgT{+WP}AO9#~$ys*gpG|+ zlVxKCw)Tj>w}tI^0t0pWFQEso(2FM=Zz03X zQ9Q*YZ$4(3BYTE5j3AFG-ZW;sfob0Sw2b05?r`J<40HW+9PN94Gq_8ZJUN5#{lGhk M>ynClRQPcJH-xGzivR!s literal 0 HcmV?d00001 diff --git a/EXPERIMENT1/bin/EXPERIMENT1/Student.class b/EXPERIMENT1/bin/EXPERIMENT1/Student.class new file mode 100644 index 0000000000000000000000000000000000000000..d115a503e39fbd714983670970c369089eeadcf5 GIT binary patch literal 1072 zcmaJmM5DQGM~6Q725goR~?>`qDWm-sU@ zftc{%5Aa7B&+Im#rj6O`+&g#9+;i@o`}@zuF95IbGKZAF)W)ax8y^~*8(Z6Jm6qvt zRA6$*2uvQx6ItsHZC}6?)S5zRF!+38ce73y6k5CXh!A6q}dV zTPE~^y(-VXC>0S_7s#%AfoEO|%#|90(0X}?=$h`RJkq%8U>rq~l*&6}pausyj9PEj z!5H$^yXN2u9Dzd93)EKkXjg^XiL_!wRntLRnvb5@rxzI+7;=_|7d)6wAm7s6u&wHz zZL!mPoK@RcKF=GiO=LoOys6B-?nHUGSjpj`z|v*wz2HP2D!!|IfkaMSwv7%?t=rtqeN8ik6yMA9jzceX!np_C@}=xP5x8hQL4f;gf-?_V=)tq9%R6JnDiW;3*7oYlr%}5xWi#e^B>^~J7-*B zr!2OdG1?T*$1%aRz@5*1hIZQhiAi_i98>PfIcD7DbIkpS(eqqqnbGFSFw+=kb%L3u znB_X7ZgL+BxWOGW;U;-S?A;hHCpC%-m|Epdq&bTa-L!C0(XJ$jHY0D kvoWF&^Ee5*$CJkW81(=pTFbY}zk)UH^7NkI8D3!iFM8GY1^@s6 literal 0 HcmV?d00001 diff --git a/EXPERIMENT1/bin/module-info.class b/EXPERIMENT1/bin/module-info.class new file mode 100644 index 0000000000000000000000000000000000000000..06ab96c61450ad22dfb8f01e8026287160d62ad9 GIT binary patch literal 150 zcmX^0Z`VEs1_oOOE_MbcMh5QO{FKt1RNc(Hw0uSeuHgLAqU2P!%$!t41_2}~y{yEt zL`DWSU$AOn26muM*N6buAWvUczYs%V22Mr>PLLYCq{QOX1_lO3pdApv#J~(>Ffp(& TumWi@1~#xTBLhbRm;oUGF54W$ literal 0 HcmV?d00001 diff --git a/EXPERIMENT1/src/EXPERIMENT1/Deserial.java b/EXPERIMENT1/src/EXPERIMENT1/Deserial.java new file mode 100644 index 0000000..16c0bfa --- /dev/null +++ b/EXPERIMENT1/src/EXPERIMENT1/Deserial.java @@ -0,0 +1,26 @@ +package EXPERIMENT1; + +import java.io.*; +class Deserial { + public static void main(String args[]){ + try{ + FileInputStream fin = new FileInputStream("d:\\f.txt"); + ObjectInputStream in=new ObjectInputStream(fin); + Student s1=(Student)in.readObject(); + Student s2=(Student)in.readObject(); + Student s3=(Student)in.readObject(); + Student s4=(Student)in.readObject(); + Student s5=(Student)in.readObject(); + + + System.out.println(s1); + System.out.println(s2); + System.out.println(s3); + System.out.println(s4); + System.out.println(s5); + in.close(); + }catch(Exception e){ + System.out.println(e); + } + } +} diff --git a/EXPERIMENT1/src/EXPERIMENT1/Serial.java b/EXPERIMENT1/src/EXPERIMENT1/Serial.java new file mode 100644 index 0000000..bfdf77e --- /dev/null +++ b/EXPERIMENT1/src/EXPERIMENT1/Serial.java @@ -0,0 +1,28 @@ +package EXPERIMENT1; + +import java.io.*; +class Serial{ + public static void main(String args[]){ + try +{ + Student s1 =new Student(1,"ram", 1000); + Student s2 =new Student(2,"shyam", 2000); + Student s3 =new Student(3,"mohan", 3000); + Student s4 =new Student(4,"sohan", 4000); + Student s5 =new Student(5,"mohan", 5000); + FileOutputStream fout=new FileOutputStream("d:\\f.txt"); + ObjectOutputStream out=new ObjectOutputStream(fout); + out.writeObject(s1); + out.writeObject(s2); + out.writeObject(s3); + out.writeObject(s4); + out.writeObject(s5); + out.flush(); + out.close(); + System.out.println("success"); + } +catch(Exception e){ + System.out.println(e); +} + } +} diff --git a/EXPERIMENT1/src/EXPERIMENT1/Student.java b/EXPERIMENT1/src/EXPERIMENT1/Student.java new file mode 100644 index 0000000..7001199 --- /dev/null +++ b/EXPERIMENT1/src/EXPERIMENT1/Student.java @@ -0,0 +1,18 @@ +package EXPERIMENT1; + +import java.io.Serializable; + +public class Student implements Serializable { + int rno; + String name; + float fees; + public Student(int id1, String name1, float fees1) { + this.rno = id1; + this.name = name1; + this.fees = fees1; + } +public String toString() { + return rno + " " + name +" " + fees +"\n"; +} +} + diff --git a/EXPERIMENT1/src/module-info.java b/EXPERIMENT1/src/module-info.java new file mode 100644 index 0000000..4992100 --- /dev/null +++ b/EXPERIMENT1/src/module-info.java @@ -0,0 +1,8 @@ +/** + * + */ +/** + * + */ +module EXPERIMENT1 { +} \ No newline at end of file diff --git a/EXPERIMENT2/.classpath b/EXPERIMENT2/.classpath new file mode 100644 index 0000000..7a13634 --- /dev/null +++ b/EXPERIMENT2/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/EXPERIMENT2/.project b/EXPERIMENT2/.project new file mode 100644 index 0000000..046a0d4 --- /dev/null +++ b/EXPERIMENT2/.project @@ -0,0 +1,17 @@ + + + EXPERIMENT2 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/EXPERIMENT2/.settings/org.eclipse.core.resources.prefs b/EXPERIMENT2/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/EXPERIMENT2/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/EXPERIMENT2/.settings/org.eclipse.jdt.core.prefs b/EXPERIMENT2/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8c9943d --- /dev/null +++ b/EXPERIMENT2/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/EXPERIMENT2/bin/EXPERIMENT2/AgeComparator.class b/EXPERIMENT2/bin/EXPERIMENT2/AgeComparator.class new file mode 100644 index 0000000000000000000000000000000000000000..c5c945345290f65c2db8972b7ba84e2d8cac4ff6 GIT binary patch literal 667 zcmZ`%TTA0W7(J7wjn>p^wbtsc7reE)8Wf*&S6HM%p;oa)e4WNnqqUJV-QVMbzV$^A z1RrFd_dh9~iD7RdWWM<>=R4n-%=~(Jd;;(dvj#MQeCgz{bX49iRqGqp_olP!U0z9F z2A*#~7Z^I1Kcv-??WT3mICt#8Ktf5AKSs@=3c`5DjPH%mb3pzjOZv%>kyHu z1=7CQmsioTk~OdE+s>Y=4sJ%^HN}q^a57h%7o&0UZ!zkpXK@$YODsDI?XlWvEJ|K264To^$3oU5SXF{ zV2BzI`9F^XBdP@5AjM0898{!4Sxmer=Vu*EdVmoq4CMRIBKp zoXS9keqg~Acy}bvq|=bi1LtS`NV%bfl)zAwZHHdNdBzK*zI#nCToy=7=640mqQ9ro zNTA1tg)V{qiq}-t_DNj@JF?zT0-1{M%Eqn?JRQeLGd%QK0%Mi`Yg-hs+(;=&CMGNY zs$6`V$*)@&6c~I-S_|8Isu^}8gJByZ7^UcaUV?xq3mE>KR``ZnSLSJ2EDygD8S_z{ z(ITR^7E1ScQ=Z0yrE7jWa8=pUquVifR`X*Vyfv;Q-^SqLeKG2$=WrL?lT$ZH|BlKw zZ7NExpqIY=1VA798S&9DK&ua5kxWw-3U|mKGuIf(nl$GZNG3YZ;U$u0$LJ8A zASLjLDu5yhR?&kJ-lL2heqaJ?$YUdFz3@aIw`L=vvXPtuvDv8oSA4*j{tY<95JCYoIly_*HI9j3zFOYd^|( zTAC;t7jx!5PtU!bkI&aP00&snpa@JAFVBkSrITW%wrf;m%RF*gchZ%f<7!X^MsDT3 zG@8=BHcsoeX2a7E6&MSm9nWeS-}M5~f@NFYp+ICUcOjr2Iag*J5e(?i&@V7twrsP~ zY1K`)ChJX8AW?Q2vUwq0%lE^e>fKmvflT>-ZFvE$5hx|e>RS1?%KYC*uB0I;ko-wn z^*UFk?ZuElO2;@RDB9){d|}^|RnN8T>wFxOnAR}Wvy^U5M+P$ju~1UY5lHj`6%D&ZOF z2j&#^gS`=Afz<~Xz+u3<*X<2?$%0vAgKwoNI2&*$F^>iRp|E3-mdgB6z`Fbe4M&cY literal 0 HcmV?d00001 diff --git a/EXPERIMENT2/bin/EXPERIMENT2/SalaryComparator.class b/EXPERIMENT2/bin/EXPERIMENT2/SalaryComparator.class new file mode 100644 index 0000000000000000000000000000000000000000..a1e4153007ce682986003b75e92f174786083b6c GIT binary patch literal 678 zcmaJeoshxEdM zE0bd`^RcD<@h$10*-@cF8dGmJt`|ppR01oiRgeI_9Jv*+R)Q_so(~8}a zz6`${2A5Ydlu;0x&;?$c%WG--viHgU*g1Ed$V5_LCe98b&$l1&0?B=^=S3d`604=Q zfPNTs-82%Iv|wUFAlvYIZgX(ial=#D@m+yjBXFeOmZ7KOaZ-;ydwqdo<2iME0;Usd zCC$oe-M4)a>!el#VbzHk1s+%)C9C(Td91)t|}FpKFj&X zLPw0$r}c@LYDLnyIFeW6;nJ;O5ISznQ{!8$5qMMaV;Q_TE`u+maq-R=rRdq*1$SfZ zJJR=Y*`iIx$qh`=w?+VDkY&V&!%JFq_>N?XvRwX!TyvdfSKs)CnSxI9^#(>__z>R0 z(1+TP@B}G=B2}pV2DUJXZOoy9dA!34c2L6mxb@D6e%zXkh$_T#%ET7p_HVI(MfEFi Z%GdOCGAq&AAIzJ`@yqbU5_1}s{{a*=h8_R_ literal 0 HcmV?d00001 diff --git a/EXPERIMENT2/bin/EXPERIMENT2/Student.class b/EXPERIMENT2/bin/EXPERIMENT2/Student.class new file mode 100644 index 0000000000000000000000000000000000000000..dbc469bece2164279300826fc5ea5759620a4dd8 GIT binary patch literal 1389 zcma)6?M@Rx6g|_He!22pN{+YI8yRh9QyIYdJiI3q& zHzxe>0ek~r#&~D92{mnuC7pZc_RN_%ch2zh_r(tYPf&~?z%a4fESjUsX;-)nN!*rmh<%11m9v4BiwB<9nC5vSVpRJx{-V6v8H0 zk=9f!Zd4moYYT2M1Z~lzk=JQ$u&UPyVRM~ZZA!K@Lvywn*3zYZ)?$CDR4NrS$3$H) zYa)&y5(>sJMa1dMaSRO83WgAt*^Gh+qB6UtAcnZi<`i7#5zhMa~*?MUnm=rwgK z>X?4#7$(!1ewpKRT^kDS;XXsM$xlVWG^*Trt2qtIY=;{Tu^;|_)B3k44%n67;UBxmtBz^4 zrJgN@PwAe+bkRQHOK#M3VK42O=4tCJ-vjH~tf%tV!lU+?7yy6YgZB-c?-kvpC~#db zYmUf|gz+$nrwn6kq5Ibjbni;ZFoadmxorzOf*pqCKFxzvMDT)a_ire@179*0$a6uu z`xt%6#xz2j*o$OgFOq@1NcQz2nb(VCU5Zg@SZ_{tr5GT_F^tnVL9<^pm)tq^J0{gx z7fE&1MM_ye%38XNEc_gunX{^xf4rZ{4S*#NJgTFP_Xtn(0Jc-Q9q{x7mNtv<*Ir&nFUuIJ3 zke5lZQf5xRRBDaPq|hh{%+hYY%raFZZ$|Bq!VU@SkiHJ7>yWk%DeGYIE2-)rbAh|S tX95T4z#vk&aLzlh;*)d_9K-_;wMkpbJ~R4<%CL=RG?UvsM*+J?{Q=c$Bmw{c literal 0 HcmV?d00001 diff --git a/EXPERIMENT2/bin/EXPERIMENT2/TEMP1.class b/EXPERIMENT2/bin/EXPERIMENT2/TEMP1.class new file mode 100644 index 0000000000000000000000000000000000000000..deb878fce79536c855a43c4ddafe1c24b6bfc2dc GIT binary patch literal 2133 zcmZuyU2qds6#j0z=_VmSy8W|IpsiGz{>6fSG=MF&kw6R@xCBhcR++w3>GSrv=LqM@Ypx-Wos zbdXL@rv;k2EB2Q1773mA;#vAn8u^7KB|3kZ{+}bjl>UF19O6SCe0j3E(x1 z38;&bCd=woWnry&Uc64`OVy8xn82>enn{17h1{ZU=}y7&;{<$uj3cgMg3Rl+A1!3F zY)i9{w*xqhN&dafs0Bjh8n_)In zHT>d~<6Gq_OerWmJrCgh$~F7>mS%9nHogO;4V2rt@?i&dQbTafkF-;Y+m8^Oe!wBw z`v?uwiq@pHXwN80P}6oj!0u)2J?k1gTBo*O>ryiTp1j{i{}1S@Q}jYtqS2(x$xg5+^mK#5S}Z;hm^Z$X;sz; zJd(ge0;zKuo=S#%HNzqqtW^e&Wbmvp)JcXq$v|C+K~}GpmjLiN4)DE=qcp(6Z^sa8 zmSEMg922)tkB_0@6J8cypb>Y_gnMYleYD^qzrRN-9%C1N#%}zAHax)|JjGu8g?;#& zH;dpM;X|jW=T*>#{h||HqKntSAP$Jb{2t{ca0)#lfnITu7eE^QB7*^8bNpZ9_bm*% zT{SBs6}Mr-VXR(p9YtJWU){lPco$dMruW%fOL&j}^aNkx8g;dd!t3f3`c30~>J)k| x={)q+i4Umr&|67YhwEhTfcGEVQxQ~=46dM;LR&!}MZ*gErJ&;*+*pH~{{ym__h0}3 literal 0 HcmV?d00001 diff --git a/EXPERIMENT2/bin/module-info.class b/EXPERIMENT2/bin/module-info.class new file mode 100644 index 0000000000000000000000000000000000000000..d777984d1d50a35116526f0373a1c690c65f0dd6 GIT binary patch literal 150 zcmX^0Z`VEs1_oOOE_MbcMh5QO{FKt1RNc(Hw0uSeuHgLAqU2P!%$!t41_2}~y{yEt zL`DWSU$AOn26muM*N6buAWvUczYrr~22Mr>PLLYCq{QOX1_lO3pdApv#J~(>Ffp(& TumWi@1~#xTBLhbRm;oUGFC84k literal 0 HcmV?d00001 diff --git a/EXPERIMENT2/src/EXPERIMENT2/Student.java b/EXPERIMENT2/src/EXPERIMENT2/Student.java new file mode 100644 index 0000000..56e5ac2 --- /dev/null +++ b/EXPERIMENT2/src/EXPERIMENT2/Student.java @@ -0,0 +1,77 @@ +package EXPERIMENT2; + +import java.io.*; +import java.util.*; + +class Student { + int rollno; + String name; + float fees; + String branch; + int year; + int sem; + int age; + static String clg; + float salary; + + public Student(int rollno,String name,float fees,String branch,int year,int sem,int age,float salary) { + this.rollno = rollno; + this.name = name; + this.fees = fees; + this.branch = branch; + this.year = year; + this.sem = sem; + this.age = age; + clg="PU"; + this.salary=salary; + } + @Override + public String toString() { + return rollno + " "+ name + " " + fees + " " + branch + " " + year + sem + " " + age + " " + clg + " "+salary+"\n"; + } +} +class AgeComparator implements Comparator { + public int compare(Object o1, Object o2) { + Student s1=(Student)o1; + Student s2=(Student)o2; + if(s1.age==s2.age) + return 0; + else if(s1.age>s2.age) + return 1; + else + return -1; + } +} +class SalaryComparator implements Comparator{ + public int compare(Object o1, Object o2) { + Student s1 = (Student) o1; + Student s2 = (Student) o2; + if (s1.salary == s2.salary) + return 0; + else if (s1.salary > s2.salary) + return 1; + else + return -1; + } +} + +class NameComparator implements Comparator{ + public int compare(Object o1, Object o2) { + Student s1=(Student)o1; + Student s2=(Student)o2; + return s1.name.compareTo(s2.name); +} +} +class FeesComparator implements Comparator { + public int compare(Object o1,Object o2) { + Student s1=(Student)o1; + Student s2=(Student)o2; + if(s1.fees==s2.fees) + return 0; + else if(s1.fees>s2.fees) + return 1; + else + return -1; + } +} + diff --git a/EXPERIMENT2/src/EXPERIMENT2/TEMP1.java b/EXPERIMENT2/src/EXPERIMENT2/TEMP1.java new file mode 100644 index 0000000..7fd8d8c --- /dev/null +++ b/EXPERIMENT2/src/EXPERIMENT2/TEMP1.java @@ -0,0 +1,53 @@ +package EXPERIMENT2; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; + +public class TEMP1 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + ArrayList sl=new ArrayList(); + sl.add(new Student(1,"Shiva",10000.00f,"cse",1,1,18,20000.00f)); + sl.add(new Student(2,"Venky",15000.00f,"ise",1,2,20,25000.00f)); + sl.add(new Student(3,"Jesus",17000.00f,"ece",1,1,19,30000.00f)); + sl.add(new Student(3,"Alla",12000.00f,"eee",1,1,19,30000.00f)); + sl.add(new Student(3,"Budha",11000.00f,"mech",1,1,21,30000.00f)); + System.out.println("Sorting by Name"); + System.out.println("_______________"); + Collections.sort(sl,new NameComparator()); + Iterator itr=sl.iterator(); + while(itr.hasNext()){ + Student st=(Student)itr.next(); + System.out.println(st); + } + System.out.println("Sorting by age"); + System.out.println("______________"); + Collections.sort(sl,new AgeComparator()); + Iterator itr2=sl.iterator(); + while(itr2.hasNext()) { + Student st=(Student)itr2.next(); + System.out.println(st ); + } + System.out.println("Sorting by fees"); + System.out.println("______________"); + Collections.sort(sl,new FeesComparator()); + Iterator itr1=sl.iterator(); + while(itr1.hasNext()){ + Student st=(Student)itr1.next(); + System.out.println(st); + } + System.out.println("Sorting by salary"); + System.out.println("______________"); + Collections.sort(sl,new SalaryComparator()); + Iterator itr3=sl.iterator(); + while (itr3.hasNext()) { + Student st = (Student) itr3.next(); + System.out.println(st); + } + } + + +} + diff --git a/EXPERIMENT2/src/module-info.java b/EXPERIMENT2/src/module-info.java new file mode 100644 index 0000000..b057867 --- /dev/null +++ b/EXPERIMENT2/src/module-info.java @@ -0,0 +1,8 @@ +/** + * + */ +/** + * + */ +module EXPERIMENT2 { +} \ No newline at end of file diff --git a/EXPERIMENT3/.classpath b/EXPERIMENT3/.classpath new file mode 100644 index 0000000..9bf265d --- /dev/null +++ b/EXPERIMENT3/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/EXPERIMENT3/.project b/EXPERIMENT3/.project new file mode 100644 index 0000000..fc00b03 --- /dev/null +++ b/EXPERIMENT3/.project @@ -0,0 +1,17 @@ + + + EXPERIMENT3 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/EXPERIMENT3/.settings/org.eclipse.core.resources.prefs b/EXPERIMENT3/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/EXPERIMENT3/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/EXPERIMENT3/.settings/org.eclipse.jdt.core.prefs b/EXPERIMENT3/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8c9943d --- /dev/null +++ b/EXPERIMENT3/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/EXPERIMENT3/bin/jdbc/Temp2.class b/EXPERIMENT3/bin/jdbc/Temp2.class new file mode 100644 index 0000000000000000000000000000000000000000..90dc7285fbf6fe76ec8747c1cfd3dbaec7b1951d GIT binary patch literal 3731 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 literal 0 HcmV?d00001 diff --git a/EXPERIMENT3/src/jdbc/Temp2.java b/EXPERIMENT3/src/jdbc/Temp2.java new file mode 100644 index 0000000..745244d --- /dev/null +++ b/EXPERIMENT3/src/jdbc/Temp2.java @@ -0,0 +1,72 @@ +package jdbc; + +import java.sql.*; +import java.util.*; +public class Temp2 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + try{ + Class.forName("com.mysql.jdbc.Driver"); + Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3308/employee","root","Akash@123"); + Statement stmt=con.createStatement(); + int ans=1; + do { + System.out.println("1. Insert a record "); + System.out.println("2. Delete a record "); + System.out.println("3. Modify/Edit a record "); + System.out.println("3. Display list of records "); + Scanner sc = new Scanner(System.in); + System.out.println("Enter your choice:"); + int ch = sc.nextInt(); + String ename; + int eno,age; + String query=""; + + switch(ch) { + case 1: + System.out.println("Enter employee number:"); + eno = sc.nextInt(); + System.out.println("Enter employee name:"); + ename = sc.next(); + System.out.println("Enter employee age:"); + age = sc.nextInt(); + query = "INSERT INTO emp " + "VALUES (" + eno+ ",'" + ename+"',"+ age+")"; + stmt.executeUpdate(query); + break; + case 2: + System.out.println("Enter employee number:"); + eno = sc.nextInt(); + query = "delete from emp where rno='"+eno+"'"; + stmt.executeUpdate(query); + System.out.println("Record is deleted from the table successfully.................."); + break; + case 3: + PreparedStatement ps = null; + query = "update emp set name=? where rno=? "; + ps = con.prepareStatement(query); + System.out.println("Enter employee number:"); + eno = sc.nextInt(); + System.out.println("Enter employee name:"); + ename = sc.next(); + ps.setString(1, ename); + ps.setInt(2, eno); + ps.executeUpdate(); + System.out.println("Record is updated successfully......"); + break; + case 4: + ResultSet rs=stmt.executeQuery("select * from emp"); + while(rs.next()) + System.out.println(rs.getInt(1)+" "+rs.getString(2)+" "+rs.getInt(3)); + } + System.out.println("Enter another(1/0)"); + ans = sc.nextInt(); + }while(ans==1); + + con.close(); + }catch(Exception e){ System.out.println(e);} + } + +} + + diff --git a/EXPERIMENT3/src/module-info.java b/EXPERIMENT3/src/module-info.java new file mode 100644 index 0000000..ee1f357 --- /dev/null +++ b/EXPERIMENT3/src/module-info.java @@ -0,0 +1,9 @@ +/** + * + */ +/** + * + */ +module EXPERIMENT3 { + requires java.sql; +} \ No newline at end of file diff --git a/EXPERIMENT4/.classpath b/EXPERIMENT4/.classpath new file mode 100644 index 0000000..7a13634 --- /dev/null +++ b/EXPERIMENT4/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/EXPERIMENT4/.project b/EXPERIMENT4/.project new file mode 100644 index 0000000..621a6c1 --- /dev/null +++ b/EXPERIMENT4/.project @@ -0,0 +1,17 @@ + + + EXPERIMENT4 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/EXPERIMENT4/.settings/org.eclipse.core.resources.prefs b/EXPERIMENT4/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/EXPERIMENT4/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/EXPERIMENT4/.settings/org.eclipse.jdt.core.prefs b/EXPERIMENT4/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8c9943d --- /dev/null +++ b/EXPERIMENT4/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/EXPERIMENT4/bin/lambdaExperession/Student.class b/EXPERIMENT4/bin/lambdaExperession/Student.class new file mode 100644 index 0000000000000000000000000000000000000000..30519a9f65d5caab5ed298687c81056871e49fac GIT binary patch literal 1090 zcmaJ$iYS1wjjslr-|*C*5%i9{0A2O50vX@Ifac9|i&Lu23k8U74S zASQkA2l%6mXLdI!hSrCfbI#0n&iT&e_n-4$0AAo(5;2Cn%ZI%IfAeJ|JmLF}lC_Q= z4}{c7Bp9;C{FK*RE)Q!TddH%#8RDK)46MbFkbEc@*4h`Kj`kdRSSJ)eq_4zhA$$Ti z85W;A($Oy&a+TJ+L#tWs61<@XB8@n*7A#z&D3xk=2@LBN7O-fvO$$k+jJ9oIDSXRY zNMo5H({`kIKOXjkcffmYKuz_z+vT2P?C3F}j~pUZY+qSA@lRE#qaNO} za2t1s$&jCjhLU}*KRWt|G+%S6DM$5+TIb_2q&sTt^+nS$#I0xu`=+%thSy4IUweG? zPUs^w@YATkPNK?CzG%K9Pt}Q_`I#Ane44zkm3L-{-e>q$nMoX>!+>wO9Js zkLok9XrePO|2Q6;jl?DJPc!&%aq6>8j6yWH>vkM1>X}8{OJSetW~EYzP9Vr^Nh!RB z%Y9$?NjzfMoh$dU0+M*baO3|_TFJ0llxUmcG|vPbS~I#~mMoC8Vu7RuBN-#4g%!G2 z$@)t60?C5?6B)ZW#hSf0#fH5z#g@IDm?HNh@F^Hf5NDZkn6+IY|5dCbgFLb*(*M&i z60T#1EQ2>pSfCj$u|P9y4AX*Hc#1_u;%3C=6?qu^mOUXN6XG!m^xQcWi0||hBR@n@ jH-oHJ=n-X&qa2`iahGI@{`TlRK#i<4X%F$3c;^2C|3&uv literal 0 HcmV?d00001 diff --git a/EXPERIMENT4/bin/lambdaExperession/exp4.class b/EXPERIMENT4/bin/lambdaExperession/exp4.class new file mode 100644 index 0000000000000000000000000000000000000000..b070cdff5df1541b1544a0c824bc5ab51b033212 GIT binary patch literal 2937 zcma)7`*Raj6#i}r-83vTq@_?>AtFfALc^mzFi;DXN;EA5FhvglwWk5qA=t5v*SPFKOug1chjb{(;+iS?w)(@chC9G`Og0R-?cvh?8X%Z zH3Cg}t&quS`zDKeNw;moGUNJWu}eWfAUvi`Xz{#ej>HdS#`LTsP`k@84X0aRNn314 zAkb^&^bnSyPQ_Bx3e=|zQy(Z7GJ0uH%j9)|NXp7;`5~=j$Y}C zXokt~+K#1Wqewd?!yHM(h7_z6XmB^mj**Y=DV4OTlwms|gi)uUQJ{G~blNHBbkhl< ziScWhY@qLa4?<`_vyA>W#?zLZe_OIIHY8zNRosrX@?X$(?0S~jZ}dHuS|^)3a&Wz(f8-b<>=1zqwP#*m7`c%1hPTcv$kc2po* z&D;D#v7sQ2QhilH^y#`Cp)wgo0Ed{pRvMw?8Wzx#fZ&ebcXRbbC5pU2%K}36)kKe` zxe}i$R%E`ts<<-}-L(i-H_?`-9W6WFuNB={q2M^{?`e6%R)L*uiyU8ME0(OI(8pAa zgZTucVB~C?H(Nq5QB+{fRjE67R6GrKV4bgtLHaDHAhuAAy-og5ZI#fs$?Km{F^MTT zLPmJIpkrm5o@*D&Ob*+M?+yv|yowj_A~P9gor%T%uIzUSgwj^Il-2tTIf3isK<|{9 zGO4|m<=9S1EB5QosFkxrcnxnTcwJ!qEEk43VU6qYl>2I+qc*H%slF){Z{jV1WrbOj zz(3WK&_C&c@7K&+Ubi=-ENi@6^p)E7d}TEBJ|BwYVz> zlUE%?8Q>C*en8=uFLOT2Rh<7qTH3E7_zM>`d}YGjmcPrmRy_y)FXvMoR-oQHEDjJN zK-=Z(2p_phy>(ni!;wH_Rk$&-`YP5;qvfz`S{hjwu8-VNZK{o|4~HTfeABPk80nbC zmX2%K0sM}8`LKK7A{w{+fjt6$p`o8Ho2T&*4G#;PyYa6)GTk!Ra~gVDk7GzwSvTwS2B8$*-l2b=fFkIJYs5JY2-`e@xgT8L;9 zM4QOnjMY?y6`H{c&0w*&eXQ-ol06e7(d{hB&26*VMe^Dv=&}IDLLDrS*>h(Y%yVbv zMblChjXD#}Y-Uu@Ek@HiKN{BTWyW8FSMVzTyQqgVw7rA(@V>kH03Wl`()KCN;R|PLLYCq{QOX1_lO3pdApv#J~(>Ffp(& TumWi@1~#xTBLhbRm;oUGFQFXA literal 0 HcmV?d00001 diff --git a/EXPERIMENT4/src/lambdaExperession/Student.java b/EXPERIMENT4/src/lambdaExperession/Student.java new file mode 100644 index 0000000..6482f99 --- /dev/null +++ b/EXPERIMENT4/src/lambdaExperession/Student.java @@ -0,0 +1,23 @@ +package lambdaExperession; + +import java.util.*; +class Student{ + int rno; + String name; + int age; + float fees; + + public Student(int rno, String name, int age, float fees) { + super(); + this.rno = rno; + this.name = name; + this.age = age; + this.fees = fees; + } + + + @Override + public String toString() { + return rno + " " + name + " " + age + " " + fees; + } +} \ No newline at end of file diff --git a/EXPERIMENT4/src/lambdaExperession/exp4.java b/EXPERIMENT4/src/lambdaExperession/exp4.java new file mode 100644 index 0000000..65eeada --- /dev/null +++ b/EXPERIMENT4/src/lambdaExperession/exp4.java @@ -0,0 +1,31 @@ +package lambdaExperession; + +import java.util.ArrayList; +import java.util.Collections; + +class exp4 { + public static void main(String[] args) { + ArrayList s = new ArrayList(); + s.add(new Student(1,"abc",20,20000.00f)); + s.add(new Student(2,"xyz",15,15000.00f)); + s.add(new Student(3,"def",10,10000.00f)); + + System.out.println("Sorting on the basis of name..."); + + // implementing lambda expression + Collections.sort(s,(s1,s2)->{return s1.name.compareTo(s2.name);}); + for(Student l:s){ + System.out.println(l); + } + System.out.println("Sorting by age"); + + Collections.sort(s,(s1,s2)-> s1.age - s2.age); + s.forEach((l)->System.out.println(l)); + + System.out.println("Sorting by Fees"); + + Collections.sort(s,(s1,s2)-> (int)s1.fees - (int)s2.fees); + s.forEach((l)->System.out.println(l)); + + } +} \ No newline at end of file diff --git a/EXPERIMENT4/src/module-info.java b/EXPERIMENT4/src/module-info.java new file mode 100644 index 0000000..057f568 --- /dev/null +++ b/EXPERIMENT4/src/module-info.java @@ -0,0 +1,8 @@ +/** + * + */ +/** + * + */ +module EXPERIMENT4 { +} \ No newline at end of file diff --git a/labsheets/~$xp1_M1.docx b/labsheets/~$xp1_M1.docx deleted file mode 100644 index 7cb0ed71b40254ac6d5d08d29351172e3d8becf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmd;f%uX!MQ1H%AO3Yy(8gMf>GGsF(G88jpFeos1GvqTQ0eP4Pl>KT?XV74npfGp$ r+Xsvc3Ytd1H*qHfH`Ev8mT(~{fH%7