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 (1728)
 Advanced Java interview questions  Advanced Java Interview Questions (332)
 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 (147)
 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
 
What is Three tier architecture. Can anyone explain with a Ordinary web application Project? (JSP,Servlets,JAVA,DAO) ? TCS 3
How you can create a radio buttion using Checkbox class?   1
what is the difference b/w design pattern and architecture Covansys 4
Convert a binary search tree to a sorted doubly linked list inplace. Amazon 1
what value will be return by the read() method once it reaches the end-of-file? a. Throws EOException b. Return null c. Return -1 d. Read method return nothing, because it is void method   1
write a program to create an arraylist and listeterator.and value should be enter through keyboard. Axcend 1
What are the two major components of JDBC? Mind-Tree 5
What is the alternate of 'Inheritance' ? HCL 3
What are listeners in java and explain ? TCS 2
what is an virtual function TCS 2
Which method will get invoked first in a stand alone application?   1
what is the main differene between synchronize() method and Synchronize{}block? 3i-Infotech 1
 
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