Tasks studies - laboratory
For this lab, a report on the results of tasks must be prepared. Program codes should also be added in text form.
Launch the NetBeans environment and then:
A) Create a new project and name it HelloWorld
or, alternatively, HelloWorld
with a numerical index, e.g., HelloWorld1, if a project named “HelloWorld” already exists.
B) Enter the following program code in JAVA into the project:
While entering the code into the project, ensure it is placed in the correct section to avoid mistakenly adding it to a different, previously created project in the environment. The correct location for code entry in the project menu (on the left side) is highlighted in pink in the image below. After entering the program code, compile it by clicking the green triangle (marked with a red circle in the image below).
If the code is entered correctly, the compiler will execute it, and the program’s output will be displayed in the console. Otherwise, the console will show an error message indicating issues in the code. The image below illustrates a case where a mistake occurred while entering the code—the compiler indicates the line with the syntax error.
Java is a strongly-typed language and highlights syntax errors during code editing.
C) Please display the results of the correctly written program and include them in the report along with a brief explanation.
Create a new project named “SystemProperties”. In the main
method, insert the following code. Run the program and display the results. Include the results displayed in the console in the report along with a brief explanation.
Create a project named “DeklaracjaWlasna”. In the main
method, insert the following code. Run the program and display the results. Include the results displayed in the console in the report along with your own reflections on the content of the declaration.