Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Java by (3.9k points)

Error

% javac  StringTest.java 

StringTest.java:4: variable errorSoon might not have been initialized

        errorSoon[0] = "Error, why?";

Code

public class StringTest {

        public static void main(String[] args) {

                String[] errorSoon;

                errorSoon[0] = "Error, why?";

        }

}

1 Answer

0 votes
by (46k points)

Try: 

String[] args = new String[]{"firstarg", "secondarg", "thirdarg"};

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...