java notes(kind of - easier to learn than chatgpt)
- First of all java is written in .java files
-it changes java into something that computers can understand
-here are some java syntax rules
# evry sentence ends with a semicolan ;
# it's code is case sensative that means "Main doesnt" mean "main"
curly braces {} define code blocks
Then there are java comments which dont effect the code and can be written
after using // for not affecting the codes
this is a basic java code outta chatgpt
="public class Hello {
public static void main(String[] args) {
[Link]("Hello, world!");
}
}"
here as far i understand public class hello is like a container for my code
and main is the starting point of the program
---Now the variables(storing data)
they hold values
here is again a example from chatgpt
" int age = 15; // whole number
double height = 5.7; // decimal number
String name = "Aman"; // text
boolean isStudent = true; // true or false "
Here the "int" can hold normal numbers like 1,2,3,4,5 but not decimals
Now the "double" can hold decimals and also numbers
And "string" holds texts
And finnaly boolean is for true/false
there is also "char" which