I'm new to programming in Java (even though I'm used to code in C, html and some other languages (vaguely)).
I'm trying to create a simple Hello World program, and I'm unsure of why, and what the "static" tag does. I tried to do some research, and I came up with that the static tag makes the method work as an instance in a moment, instead of having to "launch" it (didn't quite understand it). I'm wondering where, and why to use it.
On the other hand, while I'm compiling, I found out how to make it execute, but some friends of mine have told me that I need to include a manifest, and run it as a .jar, (I'm using:
$ javac Potato.java
$ java Potato
)
As a note, I would like to tell you that I'm trying to avoid using 3rd-party softward to learn programming (using the standard Notepad++ and bash).
Thank you ;)
Edit: Sorry, this was my first question.
class Potato {
static String textA = "Hello There";
public static void main(String[] args){
System.out.println(textA);
}
}
I got this code, and I did some mixing by creating the variable textA inside and outside of the main method.