Today we looked over creating a simple file and class on Terminal.
Through terminal, we were able to look through the difference functions that we could perform on the terminal bash.
The first step to the task of creating a file that we could carry out included creating a directory on our desktop, to do this, we use the syntax: ‘ cd desktop (finding the directory for the desktop) –> mkdir HelloWorld.java (creating the folder which will include the java file –> nano HelloWorld.java (opening the editing directory for the file)’
This opens up a directory on terminal that looks different (^^^as inserted above^^^)
Within this tab, we inserted the syntax:
”
public class HelloWorld {
public static void main( String[] args ) {
System.out.println( “Hello World!” );
System.exit( 0 ); //success
}
}
”
This, followed by:
‘ javac HelloWorld.java ‘
and
‘ less HelloWorld.java ‘
summons a window that shows you what it looks like on a window without code : )