Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Interview-Questions java fundamental question related to string
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sajna cs
java fundamental question related to string
0 Answer(s)      3 years and 7 months ago
Posted in : Java Interview Questions


public class Myclass { Public static void main(String args[]) { String s=‚??hello‚??; StringBuffer sb=new StringBuffer(s); Sb.reverse(); If(s==sb) system.out.println(‚??a‚??); If(s.equals(sb)) system.out.println(‚??b‚??); If(sb.equals(s)) system.out.println(‚??c‚??); } } Output?

a) the pgm will throw ClassCastException b) compilation fails since s==sb illegal c) compilation fails since s.equals(sb) illegal d) print c


Advertisement
View Answers

Related Tutorials/Questions & Answers:
java fundamental question related to string
java fundamental question related to string  public class Myclass { Public static void main(String args[]) { String s=‚??hello‚??; StringBuffer sb=new StringBuffer(s); Sb.reverse(); If(s==sb) system.out.println(‚??a‚
java fundamental question
java fundamental question  equivalent to 16>>2 ? a) 16/4 b) 16/2 c) 16*2 d) 16/2^2
Advertisements
java fundamental question
java fundamental question  public class WrapTest3 { Public static void main(String args[]) { String s="98.6"; // insert code here } } Which will cause compilation error: a) float f1=Float.floatValue(s); b) float f2=new Float
java fundamental question
java fundamental question  public class TestVarArgs { Public void display(Double i, double ‚?¶ j) { System.out.println(‚??Double& var args‚...;Double called‚??); } Public static void main(String args[]) { New TestVarArgs
string related question
string related question  *q.1>how i dispaly the reference of string variableS ? eg:-String s1="my name"; Sring s2="your name"; here what is address of variable s1 and s2
java question related to objects
java question related to objects  what is the output of the following code? public class objComp { Public static void main(String args[]) { Int result = 0; objComp oc= new objComp(); object o = oc; if( o==oc) result =1; if(o
java related question
java related question  How can we make a program in which we make mcqs question file and then make its corresponding answer sheet....like if we make 15 mcqs then java should generate it answer sheet of 15 mcqs with a,b,c d
Java and jvm related question
Java and jvm related question  What is difference between java data types and jvm data types
Java Related Question
Java Related Question  hi, Why java doesn't has primitive type as an object,whats an eligibility to have a primitive type as an object by the languages
Java Related Question
","mangal","to","java"}; String name; SynchronizedModel(String nam) { name...","mangal","to","java"}; String name; SynchronizedModel(String nam){ name...Java synchronized method  Dear Friend, I have written below
Java Related Question
","to","java"}; String name; SynchronizedModel(String nam... msg[]={"Welcome","mangal","to","java"}; String name; SynchronizedModel...Java synchronized method  Hi, I have written below program
string related
string related  As with any other object, you can create String objects by using the new keyword and a constructor. The String class has thirteen constructors that allow you to provide the initial value of the string using
question related to overloading
question related to overloading  what is difference between function overloading & method overloading
question related to overloading
question related to overloading  what is difference between function overloading & method overloading
Question related to Hibernate
Question related to Hibernate  Why do we use Set in child class in 1:many hibernate ,why can't we use Directly HashSet
Struts related Question
Struts related Question  Hi All, I have a one question on validation framework for client side validation please help me on that. suppose i don't want to put required=true in our JSP then what will happen. what error will come
Data base related question
Data base related question  sir my table has only one element...:odbc:oldp"); stmt2=con2.createStatement(); String st2="select * from pname order...) { e.printStackTrace(); } return regd1; } public static void main(String args[]) { raja p=new
project related question
project related question  1- how to insert a date through hibernate 2- how to insert exact time ,date separetly in the data base for current time date
String question
String question  which method is used in java to eliminate the duplicate elements in String?   import java.util.*; class RemoveDuplicates{ public static void main(String[] args){ String[] str = new String[] { "Where
related to java
related to java  what is mean of }); in java.i know that } is used to close a block of statement,) is used to close a statement and ";"is used after close a statement but i can not usderstood the use of }); together in a java
Restlet Frame work Related question
Restlet Frame work Related question  How to send data from client to server using Restlet framework. The main problem is i am not able to get data at server side. Can anyone post a complete program how to achieve
my question is related to my project viz
my question is related to my project viz   Sir, my project is based on MR tracking system developed using struts framework, it has been developed in Net Beans the whole project is working except a jsp page named dayplan.jsp
java related - Java Beginners
java related  Hello sir, I want to learn java. But I don't know where to start from. I have purchased one java related book. But I am..., shruthi  Hi friend, Java
java related - Java Beginners
is void. String args[]-Java take's each argument as string. For more...java related  Why the "public static void main(Strings args... is necessary for a java class to execute it as a command line application
java related - Java Beginners
java related  is it possible for a biggener to learn a computer language like java to learn it online ?? actually i m a computer science student(fresher) and even in 12th class i have not taken c++ and no knowledge of it ....now
Related to multiple inhetitance - Java Beginners
Related to multiple inhetitance  Sir, Plz help me to solve this question. Q.1. Write a Progarm to illustrate the concept of multiple inheritance using interface
coding related - Java Beginners
{ public static void main(String[] args) throws IOException{ BufferedReader...)); System.out.println("Enter the lower string value"); String str = buff.readLine(); char.../java/java-conversion
PHP related - how to explot a string with commas and store into two different variables?
PHP related - how to explot a string with commas and store into two different variables?  Hi, I have a string and is like this '[tubelist 123456,54321,56789,98765]'. I would like to extract the first value after the tubelist
Frame related query - Java Beginners
Frame related query  hi..... i m having a query dat...can i open a frame inside another frame like dis.. m a new biginner of java n m finding...()); } } } public static void main(String args
baaank acoounts related - Java Beginners
baaank acoounts related  hi all i have one code but that is not working kindly help me send me a working code as i a am totally new to java... for Savings account - Customer Name. - Customer Address of String type
Thread'd wait() related >>>>>>> - Java Beginners
Thread wait in Java  Hello, Seeking for a thread wait example in java. Also What is thread wait method and when we should call it in the application.Thanks
 

 

 

DMCA.com