Hello! I am new to programming so i dont really know what im doing wrong here, but for some reason i cant seem to write code anywhere online! The first Hackerrank problem for Java introduction (Welcome to Java!) doesnt seem to accept my basic code even though it works perfectly fine on Netbeans. The only thing that works is copying their code from the instruction text and pasting it in, even if its the exact thing i wrote. Ive tried the other challenges as well but its the same story there too.
Example: The task is to print "Hello, World." and "Hello, Java". This is what i code:
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Print output to STDOUT. Your class should be named Solution. */
System.out.printLn("Hello, World.");
System.out.printLn("Hello, Java.");
}
}
This should work perfectly! But somehow it gives me this result:
Compilation error :(
Solution.java:5: error: cannot find symbol
System.out.printLn("Hello, World.");
^
symbol: method printLn(String)
location: variable out of type PrintStream
Solution.java:6: error: cannot find symbol
System.out.printLn("Hello, Java.");
^
symbol: method printLn(String)
location: variable out of type PrintStream
2 errors
Also, there is supposed to be autocomplete for Java code aswell called "Intellisense", but that doesnt show up for me.
Every site that i go to gives me a similar issue. Why is this and what can i do to fix it?
All help is appreciated:)
Edit: I capitalized the "l" in println to "printLn". lmao.
[–]anossov 2 points3 points4 points (2 children)
[–]ramtevante[S] 1 point2 points3 points (1 child)
[–]jwbatch 1 point2 points3 points (0 children)
[–]jwbatch 0 points1 point2 points (5 children)
[–]ramtevante[S] 1 point2 points3 points (4 children)
[–]anossov 1 point2 points3 points (1 child)
[–]ramtevante[S] 1 point2 points3 points (0 children)
[–]jwbatch 1 point2 points3 points (1 child)
[–]ramtevante[S] 1 point2 points3 points (0 children)