Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
quick help with terminal command
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MKoop" data-source="post: 1169265" data-attributes="member: 120654"><p>The class designations was actually an error on my part because when I copy and pasted the code I didn't think the file name was capitalized. (but it is in reality).</p><p></p><p>I'm no expert and am still learning java. The ("counter" + counter*counter) after the println statement is in response to the following requirement:</p><p></p><p>"In the while loop, output the counter variable. Then output counter squared on the same line with a space in between the two values."</p><p></p><p>I tried to run even some very basic code:</p><p></p><p>/**</p><p>* This is the main method for this class</p><p>*</p><p>*</p><p>* @author XXXXXX</p><p>* @param args</p><p>*/</p><p></p><p>public class testcheck {</p><p>public static void main(String[] args) {</p><p>int one;</p><p>String name;</p><p>one = 25;</p><p>name = "Fred";</p><p>System.out.println("The integer is: " + one + "\n"</p><p>+ "The name is: " + name);</p><p>}</p><p>} </p><p></p><p>with the following:</p><p></p><p>Matthew-lastname-MacBook-Pro-2:~ Matt$ javac Documents/Professional/java/testcheck.java</p><p></p><p></p><p>Documents/Professional/java/testcheck.java:20: illegal character: \0</p><p></p><p>^</p><p>Documents/Professional/java/testcheck.java:20: illegal character: \0</p><p></p><p>^</p><p>Documents/Professional/java/testcheck.java:20: illegal character: \0</p><p></p><p>(This error repeats 100x)</p><p></p><p>--This compiled and ran with no errors in DOS</p><p></p><p>I know java is integrated, but is there anything at all I need to download that could be causing this? An update or package or anything?</p></blockquote><p></p>
[QUOTE="MKoop, post: 1169265, member: 120654"] The class designations was actually an error on my part because when I copy and pasted the code I didn't think the file name was capitalized. (but it is in reality). I'm no expert and am still learning java. The ("counter" + counter*counter) after the println statement is in response to the following requirement: "In the while loop, output the counter variable. Then output counter squared on the same line with a space in between the two values." I tried to run even some very basic code: /** * This is the main method for this class * * * @author XXXXXX * @param args */ public class testcheck { public static void main(String[] args) { int one; String name; one = 25; name = "Fred"; System.out.println("The integer is: " + one + "\n" + "The name is: " + name); } } with the following: Matthew-lastname-MacBook-Pro-2:~ Matt$ javac Documents/Professional/java/testcheck.java Documents/Professional/java/testcheck.java:20: illegal character: \0 ^ Documents/Professional/java/testcheck.java:20: illegal character: \0 ^ Documents/Professional/java/testcheck.java:20: illegal character: \0 (This error repeats 100x) --This compiled and ran with no errors in DOS I know java is integrated, but is there anything at all I need to download that could be causing this? An update or package or anything? [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Operating System
quick help with terminal command
Top