ALLInterview.com :: Home Page            
 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  >>  Java Related  >>  Java J2EE  >>  Core Java
 
 


 

 
 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
How can you take string into InputStream?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can you take string into InputStream?
Answer
# 1
string are converted to bytes and taken to FileInputStream 
Is This Answer Correct ?    0 Yes 1 No
Neema
 
  Re: How can you take string into InputStream?
Answer
# 2
String str="";
int i=0
InputStream in=new FileInputStream("File url");

while((i=in.read())!=-1)
{
str=str+(char)i;
}
System.out.println(str);
 
Is This Answer Correct ?    1 Yes 0 No
Himanshu Gupta
 
 
 
  Re: How can you take string into InputStream?
Answer
# 3
Step 1: Convert String to byte array

Step 2: Create a ByteArrayInputStream passing bytes[] to to
the contructor
 
Is This Answer Correct ?    4 Yes 0 No
Sudhakar P
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is OOP? BMC2
What are the parameters used in Connection pooling? IBM1
what is the default value of a variable char?(If not assigned)  4
What is the catch or declare rule for method declarations?  1
"We cannot create an object of interface but we can create a variable of it". Discuss the statement with the help of an example. (Plz help us to provide immediately.)  3
What is JVM ? use of JVM? Tech-Mahindra5
What is the difference between this() and super()? TCS14
What is static binding and where it occurs?  4
What is Exception handling in Java How do you handle run time errors please explain with an example TCS2
What are order of precedence and associativity, and how are they used?  1
what is the difference between a java object reference and c++ pointer?  4
how can be object class inherited to all class in a program when java does not support multiple inheritance??  4
 
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 © 2012  ALLInterview.com.  All Rights Reserved.

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