2 Simple program using BlueJ We shall now use the BlueJ IDE to develop a simple Java program to latest say ‘Hello’. Note: BlueJ may look slightly different. In BlueJ select: Project New Project. Create a in a suitable location - – project ‘Summer project’ Create New Class type HelloWorld for class name - Ok. – – Double click the HelloWorld class to open the code edit window (or right click Open Editor). – Delete all the example code and type in the HelloWorld code as shown below, but with your own name after author (and not anything in the dashed rectangles which are notes to help you). Note: Java comments do not affect how a program runs but are used to help a programmer Indent code to help readability (does not affect compilation / execution): use Edit - Auto-layout Semi colon ; curly brackets {, } round brackets (, ) and square brackets [, ] must be used correctly and are NOT interchangeable. To see line numbers (in the code editor): Options preferences display line numbers. – – BlueJ reference site: Click compile (you should get compiled - - otherwise check lines 5 to 11 ‘Class no syntax errors’ are correctly typed Java is case sensitive, and remember curly brackets and semicolon Java – – is fussy! Close the editor. Right click the HelloWorld class Select void main(String[] args) Select Ok The terminal window should as output as shown: contain “Hello World!” {Note: It is possible to write Java using a normal text editor, and compile and run java programs using the Java SDK without need for an IDE such as BlueJ by using the command line interface. You are not required to do so, but if you are interested to do this, see or YouTube tutorial 2 running Java: .} youTube reference links for installing BlueJ and a HelloWorld program, zaychenok Java Lesson 1&2: , Now you are ready to start work. Allow at least 12 hours to complete the work that follows.
2 Simple program using BlueJ We shall now use the BlueJ IDE to develop a simple Java program to say ‘Hello’. Note: latest BlueJ may look slightly different. In BlueJ select: Project – New Project. Create a project ‘Summer project’ in a suitable location - Create – New Class – type HelloWorld for class name - Ok. Double click the HelloWorld class to open the code edit window (or right click – Open Editor). Delete all the example code and type in the HelloWorld code as shown below, but with your own name after author (and not anything in the dashed rectangles which are notes to help you). Note: Java comments do not affect how a program runs but are used to help a programmer Indent code to help readability (does not affect compilation / execution): use Edit - Auto-layout Semi colon ; curly brackets {, } round brackets (, ) and square brackets [, ] must be used correctly and are NOT interchangeable. To see line numbers (in the code editor): Options – preferences – display line numbers. BlueJ reference site: Click compile (you should get ‘Class compiled - no syntax errors’ - otherwise check lines 5 to 11 are correctly typed – Java is case sensitive, and remember curly brackets and semicolon – Java is fussy! Close the editor. Right click the HelloWorld class Select void main(String[] args) Select Ok The terminal window should contain “Hello World!” as output as shown: {Note: It is possible to write Java using a normal text editor, and compile and run java programs using the Java SDK without need for an IDE such as BlueJ by using the command line interface. You are not required to do so, but if you are interested to do this, see or YouTube tutorial 2 running Java: .} youTube reference links for installing BlueJ and a HelloWorld program, zaychenok Java Lesson 1&2: , Now you are ready to start work. Allow at least 12 hours to complete the work that follows.
Summer_task_2017.docx