Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:01:40+00:00 2026-06-06T07:01:40+00:00

I have a problem with BlackBerry JDE 6.0 The following code give me the

  • 0

I have a problem with BlackBerry JDE 6.0 The following code give me the warning (and cause error at runtime)

 String s = "hello";
 doSomeStuff(s + "world");

The warning:

Warning!: Reference to undefined class: java.lang.StringBuilder

I don’t use any StringBuilder. I have searched and found The most recent version of RIM API does not contain StringBuilder class.

Changing JRE version into 1.4 can help, but it gave me a big trouble because I couldn’t use generic collection and some new apis in this version.
Another solution is I can use StringBuffer, but can’t I simply use ‘+’ operator? Why is it hard to try?
Update:
I looking for another way to use ‘+’ operator, because my code has used many of them and I don’t want to spend many time to replace all of them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:01:42+00:00Added an answer on June 6, 2026 at 7:01 am

    The Java compiler will automatically convert any expression with a series of string concatenations to use a buffer. Before Java 1.5, there was only one choice – StringBuffer. However, it suffered from the convention in early Java of synchronizing all public methods. In Java 1.5 a new buffer class was added – StringBuilder – which is better because it drops synchronization, leaving it up to users of the class to properly synchronize access. When the Java compiler is targeting Java 1.5 or later, it will use StringBuilder. For pre-1.5, it will use StringBuffer.

    BlackBerry devices use Java-ME, which is based on Java 1.3, so no StringBuilder class is present. Your problem is that you are writing modern Java-SE code and expecting to deploy it on a Java-ME BlackBerry device. If you are using Eclipse, change your Java language compliance level to 1.3. This will make the compiler properly produce StringBuffer references. It will also make use of generics a syntax error. This is expected for BlackBerry development – you don’t get generics.

    Example code:

    public class test {
        public static String concat(String a, String b) {
            return a + b;
        }
    }
    

    Bytecode result when compiled with javac -source 1.5 -target 1.5 test.java

    public static java.lang.String concat(java.lang.String, java.lang.String);
      Code:
       0:   new     #2; //class java/lang/StringBuilder
       3:   dup
       4:   invokespecial   #3; //Method java/lang/StringBuilder."<init>":()V
       7:   aload_0
       8:   invokevirtual   #4; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
       11:  aload_1
       12:  invokevirtual   #4; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
       15:  invokevirtual   #5; //Method java/lang/StringBuilder.toString:()Ljava/lang/String;
       18:  areturn
    

    Bytecode result when compiled with javac -source 1.3 -target 1.3 test.java

    public static java.lang.String concat(java.lang.String, java.lang.String);
      Code:
       0:   new     #2; //class java/lang/StringBuffer
       3:   dup
       4:   invokespecial   #3; //Method java/lang/StringBuffer."<init>":()V
       7:   aload_0
       8:   invokevirtual   #4; //Method java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
       11:  aload_1
       12:  invokevirtual   #4; //Method java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
       15:  invokevirtual   #5; //Method java/lang/StringBuffer.toString:()Ljava/lang/String;
       18:  areturn
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have our Hello-Hello Spanish application ready for sale on blackberry app world. Earlier,
I have a problem attaching an image to a blackberry email. In my code
My application in J2ME, I have just changed Emulator Platform to Blackberry JDE 6.0.0
I am having the following problem when playing sounds on the blackberry: The first
I have a problem with the blackberry 9000 and other lower version of blackberry
Hello all i stuck at one problem. I have implemented a ListField in one
i am new in blackberry development world. and i have task to develop the
I have a problem with Blackberry. // Stream connection streamConnection = (StreamConnection) Connector .open(_url);
I'm developing with Phonegap on BlackBerry and i have a problem with html5 input
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.