In this week, we will be going to going over the Lab notebook, Java Hello and Linux Bash commands.
Java Hello:
Static example The class HelloStatic contains the classic “Hello, World!” message that is often used as an introduction to a programming language. The “public static void main(String[] args)”, or main method, is the default runtime method in Java and has a very specific and ordered definition (signature).
The key terms in HelloStatic introduction:
“class” is a blueprint for code, it is the code definition and must be called to run “method” or “static method” in this case, is the code to be run/executed, similar to a procedure “method definition” or “signature” are the keywords “public static void” in front of the name “main” and the parameters “String[] args” after the name. “method call” is the means in which we run the defined code
Dynamic Example This example starts to use Java in its natural manner, using an object within the main method. This example is a very basic illustration of Object Oriente Programming (OOP). The main method is now used as a driver/tester, by making an instance of the class. Thus, it creates an Object using the HelloObject() constructor. Also, this Class contains a getter method called getHello() which returns the value with the “String hello”.
The key terms in HelloStatic introduction:
“Object Oriented Programming” focuses software design around data, or objects. “object” contains both methods and data “instance of a class” is the process of making an object, unique or instances of variables are created within the object “constructor” special method in class, code that is used to initialize the data within the object “getter” is a method that is used to extract or reference data from within the object.