ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
I have a Person object with 5 variables and I want to store
them in a file called Person.txt. What should I do?
 Question Submitted By :: Maria
I also faced this Question!!     Rank Answer Posted By  
 
  Re: I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do?
Answer
# 1
outpurstreamobject.writeobject(object o);
flush//;
close//;
 
Is This Answer Correct ?    0 Yes 1 No
Puneet
 
  Re: I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do?
Answer
# 2
We have to implement serializable interface
 
Is This Answer Correct ?    1 Yes 0 No
S.ramesh
 
 
 
  Re: I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do?
Answer
# 3
we have imlpement ur class with java.lang.Serializible
interface and used the following steps
1)ObjectOutPutStream class(one method is their write objects
into file)
   (a)writeObject(Object obj) -------> writing for objects 
  into file.This process  is called Serializtion. 

2)ObjectInputStream class reading the objects from file
   (a)readObject(Object obj)---------> Reading objects from
fole This process is called Deserialization.
 
Is This Answer Correct ?    1 Yes 0 No
Srinu
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Java violates few objected oriented concepts. Can you explain in what way? Ness-Technologies3
how session will be expired ? Satyam2
I have a sorting issue with a Hashmap. My constraint is that I MUST use the Hashmap and work with existing code. I do a database query and place the results in a Hashmap. When I iterate thru the Hashmap, it loses the original alphabetical sorting done by the database. So, my problem is that I must sort the results coming out of the Hashmap which is then placed into another class.  1
Explain Event handling in AWT? TCS1
List interface?  2
printstream class method println() is calling using System class and its static object out .how it is explain any one in detail with example ? TCS1
What is Remote Interface ? CTS4
byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p? Wipro5
where do we use init()  2
what is session facade ?  2
what do you meant by Runtime Polymorphism? Persistent10
Explain the term serialization? Wipro6
How will you convert an ArrayList to Arrays? KPIT3
explain oops concepts with examples? TCS16
what is the use of declaring constructor as private? Sai-Softech3
What is difference between static method and static variable?  6
How to do validation of the fields in any project ?  2
Name the types of mouse event listeners ?  2
how to call a method in different package?  4
Difference between String & StringBuffer Wipro6
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com