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 7962219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:16:46+00:00 2026-06-04T05:16:46+00:00

The string called code doesn’t seem to read. Why is that and how do

  • 0

The string called “code” doesn’t seem to read. Why is that and how do I fix it?

My code (the snippet that causes problems):

String code;
for(int z = 0; z<x;z= z+0) // Repeat once for every character in the input string remaining
{
    for(int y=0;y<2;y++) //Repeat twice
    {
        c = (char)(r.nextInt(26) + 'a'); //Generate a random character (lowercase)
        ca = Character.toString(c);
        temp = code;
        code = temp + ca; //Add a random character to the encoded string
    }

My error report:

--------------------Configuration: <Default>--------------------
H:\Java\Compiler.java:66: variable code might not have been initialized
        temp = code;
               ^
1 error

Process completed.

(I am using JCreator 5.00, Java 7.)

(Yes, the error report looks stupid, but it Stack Overflow reads it as coding.)

  • 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-04T05:16:48+00:00Added an answer on June 4, 2026 at 5:16 am

    What value would code have if x is zero? The answer is it would have no value at all (not even null). You could just initialize it to an empty string if you like:

    String code = "";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a string parameter called shop that is required in
I have this function called ProperCase that takes a string, then converts the first
I have a class with a method called DataIn(int InputID, string CSVValue) , this
Every variation on the following code that I try doesn't work - whether DoSomething()
A string is called a square string if it can be obtained by concatenating
private void StringAction(string aString) // method to be called { return; } private void
Made a custom obj called Item with some string fields and one float. .h
After the web method is called, a XML string is returned as the response.
I have a Django Queryset object called data containing string keys and float values.
I have a Dictionary called AvailableBoxes. I want to lookup a string in this

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.