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                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1721)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (146)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
How can you take string into InputStream?
 Question Submitted By :: Core-Java
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
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
 
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
 
 
 
Answer
# 3
string are converted to bytes and taken to FileInputStream 
Is This Answer Correct ?    0 Yes 1 No
Neema
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
How do you relate a Interface to a Class? Tell me in Detail?   4
class A { public void disp(int a,int b) { System.out.println("hai"); } } class B { public void disp(int a,int b,int c) { System.out.println("hai"); } } above program is overloading or overriding? Wipro 9
What is diffrance between FINALIZE() & FINALLY ? Infosys 2
How are this() and super() used with constructors?   8
can we Connect Applet to Data Base ? with Discriptiom. and also What is Diff. from Applet & Servlet? Systematix 1
Can you call a constructor within a constructor?   7
What is Servlet?   8
What will happen if we cannot mention "finally" in Java Program ??? PWC 3
What is the difference between Static and final?   1
int a=1; float b=1.0; System.out.println(a==b); Honeywell 13
what is the context   2
Name the method that used to clear the buffer ?   2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com