What’s the Error?
Find and explain the errors in each of the following Java statements, or state that there is no error. If you are not sure whether a statement contains an error, experiment.
a. String howAboutThat = new String('a');
b. String String = "String";
c. Random randomNum = 3;
d. Random x = Random();
e. Random y = new Random(3);
f. import Java.util;
g. File myFile.txt = new File();
h. File MyFile = new File();
i. File f = new File(myfile.txt);
j. String text = "myfile.txt"; File myFile = new File(text);
k. String y = "testme"; y + = char(33);
l. String w = " Why Me? "; int temp = w.trim.length();
m. StringBuilder z = "How Come This Does Not Work?";
n. StringBuilder t = new String ("How Come This Does Not Work?");
o. String Builder u; u = new StringBuilder("I wonder if this will work?");
p. StringBuilder v = new StringBuilder("Try This"); v + = (char) v.length();
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.