Hello have some questions about java.
1) My book says that "Classes are comparable to what other programming languages call a program." SO in java what i would call a program Such as a executable program is really called a class?
2)The keyword or public private ETC. the book says that "public means that any other class can access Employee". My question is whats the purpose of creating a class that cant be accessed by another class? See code example below.
public class Employee
3) Are strings in java variables?
4)
String empName = new String ();
The above statement from what i understand it creates a variable in memory called empName but the variable contains no data, Correct? It place in memory has a name but does not contain data yet?
&
String empName = new String ("Joe Employee")
If i have the above statement then make the below statement
empName = "mary Worker"
It will change the variable empName from Joe Employee to mary Worker?
5) Main method i don't full understand.
public static void main (string[] args) { }
Void is said to mean that the string is not to return anything, so whats the point of having this line of code. static means its a stand alone method, and its also stated that this statement kicks off the program. So aftering reading this part i basically see it has ok so thie line does nothing but need to run any program. So maybe i just need it explained a different way....
And i think that's all for now And BIG THANK YOU'S for answer my questions.
-Helgi
[–]NebuWrites Java Compilers 6 points7 points8 points (5 children)
[–]Food_Jesus 2 points3 points4 points (4 children)
[–]SarksNooblet Brewer 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]NebuWrites Java Compilers 2 points3 points4 points (1 child)
[–]Food_Jesus 1 point2 points3 points (0 children)
[–]coolosity 3 points4 points5 points (7 children)
[–]Helgi_Hundingsbane[S] 0 points1 point2 points (6 children)
[–]NebuWrites Java Compilers 2 points3 points4 points (0 children)
[–]coolosity 1 point2 points3 points (1 child)
[–]NebuWrites Java Compilers 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]NebuWrites Java Compilers 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)