spot the mistakes
Off topic → Programming → spot the mistakes
CHALLENGE
Package shizzel.stuff
Public class some_useless_crap{
Public static void main(){
Public static void Yo(){
String E = "Redstone rules";
}
}
}
Package shizzle;
Import shizzel.stuff.some_useless_crap
Public class EXAMPlE{
Public static void main(){
String example = shizzel.stuff.some_useless_crap.Yo.E;
System.out.println(example);
}
}
SPOT THE MISTAKES. BY THE WAY HERE IS TWO DIFFERENT .JAVA FILES.
Package shizzel.stuff
Public class some_useless_crap
{
Public static void main()
{
Public static void Yo()
{
String E = "Redstone rules";
}
}
}
Package shizzle;
Import shizzel.stuff.some_useless_crap
Public class EXAMPlE
{
Public static void main()
{
String example = shizzel.stuff.some_useless_crap.Yo.E;
System.out.println(example);
}
}
And my personal paste for easier reading
Keep in mind i don’t do java, but i don’t think in example 1 java can have functions within functions.. i might be wrong.
and example two the string variable is getting set to ehhhh idk not a function, since i don’t know if .e can directly point to a variable in some class im just gonna go with that and say thats wrong.
Edit: nvm example two, package is wrong.
@PanFritz
|>i don’t think in example 1 java can have functions within functions..
You can
|>and example two the string variable is getting set to ehhhh idk not a function, since i don’t know if .e can directly point to a variable in some class im just gonna go with that and say thats wrong
You can point to a variable in another class, I should have surrounded the path with brackets though.
|>nvm example two, package is wrong.
Correct. It is telling it to look for a folder called shizzel when it is already in that folder.
==good spots for someone who does not know java== ==well done!==
package shizzel.stuff;
public class some_useless_crap
{
public static class Yo
{
public static final String E = "Redstone rules";
}
}
package shizzle;
import shizzel.stuff.some_useless_crap
public class EXAMPlE
{
public static void main()
{
String example = some_useless_crap.Yo.E;
System.out.println(example);
}
}