• HOME
  • QUIZ
  • CONTACT US
EXAMIANS
  • COMPUTER
  • CURRENT AFFAIRS
  • ENGINEERING
    • Chemical Engineering
    • Civil Engineering
    • Computer Engineering
    • Electrical Engineering
    • Mechanical Engineering
  • ENGLISH GRAMMAR
  • GK
  • GUJARATI MCQ

JAVA Strings

JAVA Strings
toString() method is defined in

None of these
java.lang.String
java.lang.util
java.lang.Object

ANSWER DOWNLOAD EXAMIANS APP

JAVA Strings
What will be the output of the following program code?public class Test{ public static void main(String args[]){ String s = "what"; StringBuffer sb = new StringBuffer("what"); System.out.print(sb.equals(s)+","+s.equals(sb)); }}

false,false
true,true
true,false
None of these
false,true

ANSWER DOWNLOAD EXAMIANS APP

JAVA Strings
What will be the output of the following program?public class Test{ public static void main(String args[]){String str1 = "one";String str2 = "two";System.out.println(str1.concat(str2)); }}

one
None of these
two
twoone
onetwo

ANSWER DOWNLOAD EXAMIANS APP

JAVA Strings
String str1 = "Kolkata".replace('k', 'a');In the above statement, the effect on string Kolkata is

Displays error message
The first occurrence of k is replaced by a.
All characters a are replaced by k.
All characters k are replaced by a.

ANSWER DOWNLOAD EXAMIANS APP

JAVA Strings
How many objects will be created?String a = new String("Examveda");String b = new String("Examveda");String c = "Examveda";String d = "Examveda";

None of this
4
3
2

ANSWER DOWNLOAD EXAMIANS APP

JAVA Strings
The String method compareTo() returns

false
1
true
-1
an int value

ANSWER DOWNLOAD EXAMIANS APP
MORE MCQ ON JAVA Strings

DOWNLOAD APP

  • APPLE
    from app store
  • ANDROID
    from play store

SEARCH

LOGIN HERE


  • GOOGLE

FIND US

  • 1.70K
    FOLLOW US
  • EXAMIANSSTUDY FOR YOUR DREAMS.
  • SUPPORT :SUPPORT EMAIL ACCOUNT : examians@yahoo.com

OTHER WEBSITES

  • GUJARATI MCQ
  • ACCOUNTIANS

QUICK LINKS

  • HOME
  • QUIZ
  • PRIVACY POLICY
  • DISCLAIMER
  • TERMS & CONDITIONS
  • CONTACT US
↑