learning java through bluej

43
computerscienceexpertise.com TOWARDS QUALITY LITERACY BlueJ : An Introduction towards JAVA Expertise Dheeraj Mehrotra City Montessori School Kanpur Road, Lucknow [email protected] www.computerscienceexpertise.com PDF created with pdfFactory Pro trial version www.pdffactory.com

Upload: dr-dheeraj-mehrotra

Post on 12-Nov-2014

5.668 views

Category:

Documents


8 download

DESCRIPTION

A must for learning Java Programming for Beginners. Especially for ICSE/ ISC Students

TRANSCRIPT

BlueJ : An Introduction towards JAVA ExpertiseDheeraj Mehrotra City Montessori School Kanpur Road, [email protected] www.computerscienceexpertise.com

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

CreditsMichael Klling School of Network Computing Monash University, Australia

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

What is BlueJ?BlueJ is a Java development environment specifically designed for teaching at an introductory level. It was designed and implemented by the BlueJ team at Monash University, Melbourne, Australia. More information about BlueJ is available at http://bluej.monash.edu.

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJInstallation BlueJ is distributed as an archive of Java classes in jar format. Installing it is quite straightforward. Prerequisites You must have JDK 1.2.2 or later installed on your system to use BlueJ. Some functionality works better with JDK 1.3, so it is worth getting or updating to the latest JDK release. If you do not have JDK installed you can download it from Suns web site at http://java.sun.com/j2se/.

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Getting BlueJThe BlueJ distribution file is named bluejxxx.jar, where xxx is a version number. For example, the BlueJ version 1.1.1 distribution is named bluej-111.jar. You might get this file on disk, or you can download it from the BlueJ web site at http://bluej.monash.edu.

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Installing BlueJWindows: Double-click the install file (bluejsetup). And follow the instructions further.

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Installing BlueJ

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Installing BlueJ

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Installation

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Installing BlueJ

Once the BlueJ with JDK is installed, double click the above icon to have the following screen.computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

BlueJ Opening Screen

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Opening a project in BlueJ

BlueJ projects, like standard Java packages, are directories containing the files included in the project. If you start BlueJ from a command line, and you give a project as an argument, it will automatically be opened. If you start BlueJ without an argument, use the Project Open... menu command to select and open a project.

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Coding a program

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Compiling the program

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Close the program

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Next Screen

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Creating an Object

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Creating an Object

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Creating Object

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Executing the program through objects

Right Click the Mouse

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Executing an Object

Select Void computerscienceexpertise.com work(String) TOWARDS function QUALITY LITERACYPDF created with pdfFactory Pro trial version www.pdffactory.com

Executing the programSupply The String as Input Within

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

INPUT STRING

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Output Screen

computerscienceexpertise.com TOWARDS QUALITY LITERACY

PDF created with pdfFactory Pro trial version www.pdffactory.com

Example Program 1// Program to compute and print all prime numbers between 100 and 500 class test1 { void prime() { int i,j,s=0,d=0; for(i=100;i