- Joined
- 11 yrs. 6 mth. 26 days
- Messages
- 5,381
- Reaction score
- 18,380
- Age
- 45
- Wallet
- 11,590$
- [email protected]
How to run Java.
In order to write Java code, it is suggested that you download a Java IDE(Integrated Development Environment).
I suggest the following:
Eclipse: Netbeans:
jCreator: Of course, there are a lot of other great options to choose from.
Structure, Syntax, and variable declaration.
Class - myClass.
Our class is called myClass. In myClass we have two constructors.
returnnumber(), which returns int x.
noreturn(), which returns nothing. (Just because you return nothing, doesn't mean you can't print something inside the constructor.)
We also have three variable.
int x, which withint returnnumber(); is set to 9.
newstring, which in the main is set to "This is how you declare a string"
boolean check, which in the main is set to false.
(Booleans are either true or false).
Comments are initialized through:
Note: EACH line must end with a ; (semicolon), unless currently in a comment
The output of this code would be:
In order to write Java code, it is suggested that you download a Java IDE(Integrated Development Environment).
I suggest the following:
Eclipse: Netbeans:
jCreator: Of course, there are a lot of other great options to choose from.
Structure, Syntax, and variable declaration.
Class - myClass.
Our class is called myClass. In myClass we have two constructors.
returnnumber(), which returns int x.
noreturn(), which returns nothing. (Just because you return nothing, doesn't mean you can't print something inside the constructor.)
We also have three variable.
int x, which withint returnnumber(); is set to 9.
newstring, which in the main is set to "This is how you declare a string"
boolean check, which in the main is set to false.
(Booleans are either true or false).
Comments are initialized through:
Note: EACH line must end with a ; (semicolon), unless currently in a comment
The output of this code would be: