aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Pls help me out to solve this question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Pls help me out to solve this question" Watch "Pls help me out to solve this question" New topic
Author

Pls help me out to solve this question

Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
I got this example from a mock site with some options .... when i tried to compile this its given me compile time error saying identifier expected... for each lines.


1. StringBuffer sb = new StringBuffer("abc");
2. String s = new String("abc");
3. sb.append("def");
4. s.append("def");
5. sb.insert(1, "zzz");
6. s.concat(sb);
7. s.trim();


Thanks <br />Poonam Agarwal SCWCD 86%
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
It should give compile time error as append()
method is not in String class..
Rajshekhar Anand
Greenhorn

Joined: May 22, 2008
Posts: 14
even concat method of String need to have argument of type String.


-Gaurav
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Yaa Gaurav is right.
Its second compile time error in code
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Poonam Agarwal,
When you post mock questions to the ranch you must also QuoteYourSources.
If you don't add a valid source for this question, it will need to be removed.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pls help me out to solve this question
 
Similar Threads
StringBuffer/StringBuilder query
Stringbuffer doubt?
Aren't Strings immutable...in which case....
Problem with String and StringXxx objects
String objects are immutable they can be shared. I do no get what this means...please help.