Core Java With OCJP/SCJP-Serialization-Part 8

  Рет қаралды 48,393

Durga Software Solutions

Durga Software Solutions

Күн бұрын

Пікірлер: 33
@asifnaqshi
@asifnaqshi 9 жыл бұрын
Super Awesome !!! Videos are so cool and so easily adaptable and understandable .... Thank U sir
@pradeepsingh-cg8iv
@pradeepsingh-cg8iv 8 жыл бұрын
good sir , anushka :)
@mdadilraza4059
@mdadilraza4059 Жыл бұрын
I am not getting output after customized Serialization like durga.... anushka I am getting durga.....null
@harshmanitripathi9319
@harshmanitripathi9319 6 ай бұрын
It might be because you are trying to call a private method.
@ashokmandadi
@ashokmandadi 5 жыл бұрын
Hi Sir,your teaching is awesome,I have one question,instead of custom seriaization,there is one more way Before doing serialization,I will not declare transient to pwd variable,I will encrypt pwd data ,then I will set this encrypt data into Account Object,then I will serialize Account object.During Deserialization,I will read Account Object from file,then I will get encypt pwd data from Account object,then decrypt this.If we follow this approach,custom serialization is not required. Please suggest me whether my approach is correct (or) not
@rajasekharb7901
@rajasekharb7901 6 жыл бұрын
Hi sir, Thanks you so much. Here I am having below doubts for the same. Let's say.. 1. We are doing encryption in writeObject(-) method and making serialization. So why we we need to this stuff?. Instead, we can create one utility class to do encryption and add the encrypted password to variable directly without making transient . Why because unnecessary we are created two variables here one is password and second one is encrypted password variable and making serialization . To avoid those two we can add directly encrypted password to the password variable and can add to file. Same this we can also do in deserialization . 2. In this example we have only one transient variable. Let's say if we have more than one transient variables then how can we read in deserialization process . Do we need to do same thing for all those variables?. 3. Is it really proper way to use transient variables for sensitive information instead of storing default values. Please reply sir. It's important to understand above cases .
@DurgaSoftwareSolutions
@DurgaSoftwareSolutions 6 жыл бұрын
Hello Rajasekhar. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627,7207212427/28
@deeproy7292
@deeproy7292 7 жыл бұрын
if there are two transient keys of different data types then what should be done...provided that encryption is done by X and decryption is done by Y!!!
@raman-jn6yt
@raman-jn6yt 7 жыл бұрын
well explained !!!!
@deepak10309
@deepak10309 9 жыл бұрын
Hi Durga Sir First of all I would like to say thanks to you for this tutorial videos. I guess you are the best teacher of JAVA. Great Work. I have a question on customized serialization concept after watching this video. Que: I guess we perform Encryption so that anybody can't get our sensitive information from File or Network. For this we are making password variable transient and encrypt that and implement writeObject method. If Encryption makes our data secure then Why don't we only Encrypt our data like password variable and not make it transient and follow normal serealization and deserialization. In this case also password is secure because it is encrypted.
@DurgaSoftwareSolutions
@DurgaSoftwareSolutions 9 жыл бұрын
Deepak patel Hi Deepak, If we are doing manually encryption and decryption then for every object we have to do individually. But customized serialization is automated process the person who is doing serialization and deserialization he is not required to do any extra things he has to write code just for normal serialization and deserialization. If customized serialization is not available then before serialization compulsory he has to write code explicitly to encrypt for every object. Similarly at the time of deserialization also which makes programming very complex..
@deepak10309
@deepak10309 9 жыл бұрын
Durga Software Solutions Thanks you very much for your reply.I got it. Please tell me how can I get all videos for core Java SCJP? As here all videos are not there.
@DurgaSoftwareSolutions
@DurgaSoftwareSolutions 9 жыл бұрын
Deepak patel Demo Sessions on youtube, Language Fundamentals(16 Videos)kzbin.info/www/bejne/m4W7lWtvqZ2hnas, Operators & Assignments(7 Videos)kzbin.info/www/bejne/Z3uqgIOeft6bd68, Flow Control(6 Videos)kzbin.info/www/bejne/jmfVhGyseZ5gp68.
@rajasekharb7901
@rajasekharb7901 6 жыл бұрын
@@DurgaSoftwareSolutions Hi sir, Thanks for the replay... Here I am having one doubt for the same. Let's say.. 1. We are doing encryption in writeObject(-) method and making serialization. So why we we need to this stuff?. Instead, we can create one utility class to do encryption and add the encrypted password to variable directly without making transient . Why because unnecessary we are created two variables here one is password and second one is encrypted password variable and making serialization . To avoid those two we can add directly encrypted password to the password variable and can add to file. Same this we can also do in deserialization . 2. In this example we have only one transient variable. Let's say if we have more than one transient variables then how can we read in deserialization process . Do we need to do same thing for all those variables?. 3. Is it really proper way to use transient variables for sensitive information instead of storing default values. Please reply sir. It's important to understand above cases .
@PremKumar-yq6um
@PremKumar-yq6um 9 жыл бұрын
sir what is the need of using default read & writeObject
@pranjalsoni1819
@pranjalsoni1819 6 жыл бұрын
but these methods are private and how jvm will identify weather it is default or cutomized
@asifnaqshi
@asifnaqshi 9 жыл бұрын
Do you have videos on understanding data structure all sorting process? If have please providde links ...
@DurgaSoftwareSolutions
@DurgaSoftwareSolutions 9 жыл бұрын
Asif Masood View 16 videos on Language Fundamentals, kzbin.info/www/bejne/m4W7lWtvqZ2hnas View 7 videos on Operators & Assignments, kzbin.info/www/bejne/Z3uqgIOeft6bd68 View 6 videos on Flow Control, kzbin.info/www/bejne/jmfVhGyseZ5gp68 View 42 videos on Collections in Java, kzbin.info/www/bejne/qHqWh55_qahjm6M View 5 videos on JSF, kzbin.info/www/bejne/qHLEYqqtjLGqZ7s View 50 videos on Oracle, kzbin.info/www/bejne/pomYiH2ZqdNmgdk View 35 videos on Hibernate, kzbin.info/www/bejne/iYubkpWHaNugmsU View 115 videos on Data Structures, kzbin.info/www/bejne/pXKkmnWHe7h4n80 View 58 videos on Struts, kzbin.info/www/bejne/pIrUpKGofaymh8k View 74 videos on Spring, kzbin.info/www/bejne/j6HWd4drZdKnntU View 41 videos on CRT, kzbin.info/www/bejne/nHW1n36GrtuFZ5Y View 12 videos on JAVA Reflections API & Annotations kzbin.info/www/bejne/eKmmqGOrid2NiNU View 39 videos on Java Real Time Project Implementation on Spring,Struts & Hibernate, kzbin.info/www/bejne/n3zRk2N3nLCNgJI View other videos on ADV JAVA kzbin.info/www/bejne/bmTNfaSKdsekh7c View 9 videos on ENUM, kzbin.info/www/bejne/imLJfoqtfp53Z6c View 16 videos on Serialization, kzbin.info/www/bejne/mHrdl6Wsmdlqp68 View 13 videos on Garbage Collection, kzbin.info/www/bejne/Z2bSZWCHl5JgsMk View 13 videos on java.Io Package, kzbin.info/www/bejne/rGWrhGSQncmbb5o View 13 videos on Regular Expressions, kzbin.info/www/bejne/gKabdqyYeamdeM0 View other videos on Tableau Desktop kzbin.info/www/bejne/g4jMdoCEfttqqLc View other videos on Selenium kzbin.info/www/bejne/favElJqci56Ffpo
@puunam
@puunam 9 жыл бұрын
thank you sir
@inayathulla1
@inayathulla1 8 жыл бұрын
Thanks a lot for amazing videos sir. Respect! I have one doubt, cant we achieve same result by default serialization itself, as in below. Please clarify.. public class Account implements Serializable{ public String uName="inayath"; public transient String pwd="admin"; } ___________________________________________________________________________________________________________ public class CustomSerDemo { public static void main(String[] args){ Account a1 = new Account(); System.out.println("user name : "+a1.uName); System.out.println("password : "+a1.pwd); try { FileOutputStream fos = new FileOutputStream("abc.ser"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(a1); oos.writeObject(new String("123"+a1.pwd)); FileInputStream fis = new FileInputStream("abc.ser"); ObjectInputStream ois = new ObjectInputStream(fis); Account a2 = (Account)ois.readObject(); String epwd = (String)ois.readObject(); a2.pwd = epwd.substring(3); System.out.println("user name : "+a2.uName); System.out.println("password : "+a2.pwd); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } ______________________ output __________________________ user name : inayath password : admin user name : inayath password : admin
@ashishbajpayi4
@ashishbajpayi4 7 жыл бұрын
Dude, if we are using Default serialization then suppose if we are intiatilizing through constructor and creating multiple objs then for multiple objs manually wehave to write encryption and decryption code readability decreases so that's y if we write encryption and decryption code inside those callback methods at once, that will be called automatically by the jvm and we don't have to do anything explicitly...
@nithinroyal59
@nithinroyal59 7 жыл бұрын
sir y those two methods throws exception
@ashishbajpayi4
@ashishbajpayi4 7 жыл бұрын
if you are talking about those callback methods then, because the default WriteObjec(-) & readObject(-) throws exception so we are calling those methods from callback methods that's y those mthods excptions are propagating into callback methods that's y there also we have to throws exceptions to jvm...
@satyamishra3329
@satyamishra3329 7 жыл бұрын
sir,in my program during compilation an error is coming like FileOutputStream not found and ObjectOutputStream not found....i dont knw why need hlp??
@ashishbajpayi4
@ashishbajpayi4 7 жыл бұрын
Hi, may be you are not importing packages for those classes, once import them and check the same...
@satyamishra3329
@satyamishra3329 7 жыл бұрын
no,after importing packages then also the same error is coming?!! though i have written the same prog as given by sir.
@ashishbajpayi4
@ashishbajpayi4 7 жыл бұрын
Hi, if you got CTE: not found then max it ll be becoz of either in particular jars classes not there or while importing packages some spell mistake have done so if you are executing from cmd prompt then might be spells issue so better check the spells of classes nd packages imports. or even if it's cmng the same send the exact copy of CTE.
@satyamishra3329
@satyamishra3329 7 жыл бұрын
import java.util.*; import java.io.*; class Account implements Serializable { String un="satya"; transient String pwd="anushka"; private void writeObject(ObjectOutputStream os)throws Exception { os.defaultWriteObject(); String epwd="123"+pwd; os.writeObject(epwd); } private void readObject(ObjectInputStream is)throws Exception { is.defaultReadObject(); String epwd=(String)is.readObject(); pwd=epwd.substring(3); } } class Custserialize { public static void main(String args[])throws Exception { Account a1=new Account(); System.out.println(a1.un+"....."+a1.pwd); FileOutputStream fos=new FileOutputStream("abc.ser"); ObjectOutputStream oos=new ObjectOutputStream(fos); oos.writeObject(a1); FileInputStream fis=new FileIntputStream("abc.ser"); ObjectIntputStream ois=new ObjectIntputStream(fis); Account a2=(Account)ois.readObject(); System.out.println(a2.un+"..."+a2.pwd); } }
@satyamishra3329
@satyamishra3329 7 жыл бұрын
see,this is my program and the same ObjectOutputStream and FileOutputStream not found is coming both output and Input.
Core Java With OCJP/SCJP-Serialization-Part 9
15:30
Durga Software Solutions
Рет қаралды 42 М.
Core Java With OCJP/SCJP-Serialization-Part 15
26:09
Durga Software Solutions
Рет қаралды 36 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 43 МЛН
Smart Sigma Kid #funny #sigma
00:33
CRAZY GREAPA
Рет қаралды 38 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 13 МЛН
Core Java With OCJP/SCJP-Serialization-Part 11
31:50
Durga Software Solutions
Рет қаралды 47 М.
Core Java With OCJP/SCJP-Serialization-Part 12
27:46
Durga Software Solutions
Рет қаралды 44 М.
System Design Interview: TikTok architecture with @sudocode
45:35
Core Java with OCJP/SCJP: Language Fundamentals Part-6 || Arrays Part-1
1:15:24
Durga Software Solutions
Рет қаралды 831 М.
Core Java With OCJP/SCJP-Garbage Collection-Part-1
29:55
Durga Software Solutions
Рет қаралды 68 М.
Core Java With OCJP/SCJP-Serialization-Part 3
26:40
Durga Software Solutions
Рет қаралды 86 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 43 МЛН