Assuming
you have excellent knowledge of POP, in this blog, we will cover OOP and Java
language with significant coding on BLUEJ.
What is BlueJ?
BlueJ is
an integrated development environment for the Java programming language,
developed mainly for educational purposes, but also suitable
for small-scale software development. It runs with the help of JDK.
BlueJ was
developed to support the learning and teaching of object-oriented
programming, and As a result, its design differs from other development
environments.
History:
The
development of BlueJ was started in 1999 by Michael Kölling and Joh Rosenberg
at Monash University, as a successor to the Blue system.
The latest version of BlueJ:
Version 4.2.2 was released on 4th October 2019.
Issues in the previous version:
Fixed an issue with an extra space appearing in the terminal before the first output.
It was
fixed not being able to alter the preferences for the Submitter extension.
To download this amazing BlueJ Software use below link:
Installation Procedure
·
Download
the installer, making sure to keep track of where it is in the file system.
·
Start
your Command Prompt or Terminal application like Windows Power Shell. You will complete the installation
by typing some commands into this application. (For Windows users, see these instructions for "how to start the Command Prompt").
·
Run
the following command:
>>>Java
-jar<path-to-bluej-installer>
... Replace <path-to-bluej-installer> with
the correct path to the installer, .jar file that you have downloaded.
·
If
you receive a "command not found" or similar error, you may need to
specify the full path to the Java executable. For example
>>>"C:\Program
Files\Java\jdk1.8.0_144\bin\java.exe" -jar
>>>"C:\Users\Sarah\Downloads\bluej-411.jar"
(This
is an example is for Windows users; other operating system paths usually use
a slash( ’/’ ) symbol as a path separator!).
· The installer should start and present a window where you can specify both the path
to the JDK and for BlueJ 4.2.0 the way to OpenJFX, (make sure it is correct!) and where you want to install BlueJ. It
is usually best to install BlueJ somewhere under your home folder.
Take note of the path as you will need it to run BlueJ later.
Running BlueJ
To run BlueJ:
- On Windows:
·
Start
the Command Prompt application.
·
Change
into the directory where you installed BlueJ:
>>>cd <path-to-bluej-installation>
... replacing <path-to-bluej-installation>
with the path you chose to install BlueJ to.
·
Start
the BlueJ batch file:
>>> bluej.bat
- On other operating systems:
·
Start
the Terminal application.
·
Change
into the directory where you installed BlueJ:
>>> cd <path-to-bluej-installation>
... replacing <path-to-bluej-installation>
with the path you chose to install BlueJ to.
·
Start
the BlueJ shell script file:
>>>./bluej
Steps for the running program on BlueJ
·
At
first, double click on the BlueJ icon, which is present on the desktop.
·
Click
on the Project option on the menu bar of BlueJ windows. It enables you to create a
directory.
·
Click
on Project and select New Project from the drop-down menu.
·
Enter
the file name in space provided (say, Com Appl 10) and click Create.
·
A window appears with the project icon.
·
Click
on the New Class button.
·
Write
the Class name (say, Welcome) and click OK.
·
Now,
double click on the folder named Welcome to open the class. A sample structure
of the class appears on the screen.
·
Select
and delete the sample structure.
·
Now,
start writing your program as illustrated below. Compile your program, which
displays the message: 'Class compiled -no syntax errors' otherwise, debug and
recompile the program unless it is error-free.
Line and word description.
Line 1: It is a comment line.
Line 2: Declaration of a class, i.e. (public class Welcome)
Line 3: Opening of the class with {
Line 4: It contains the main function. The execution of the file commences from the main () function.
Public: It declares that the file access has no restriction
Static: It is a keyword. It instructs the compiler, so that main () should run before anything else in the program.
Void: It indicates that main () will not return anything
String args []: It declares a string array, "args" stands for arguments.
Line 5: It indicates the starting of the main function by an opening brace {
Line 6: These are only executable statements of the program.
Line 7: closing brace}, to close the main function
Line 8: closing brace}, to close the
class.
Execution of the Program
The following steps are to be done to execute a
java program.
·
Select
the icon of the class (say, class name) and click the right button of the
mouse.
·
A drop-down menu appears on the screen. Select and click void main (String []
args).
·
A
method call window appears on the screen. Click OK.
·
The desired output of the program appears as shown below
Differences between JDK 1.3 and BlueJ
Some sprinkle of OOP and JAVA
Define: An Object-Oriented
Programming (OOP) is a modular approach, which allows the data to be applied
within the stipulated program area. It also provides the reusability feature to
develop productive logic, which means to give more emphasis on data.
Define: Object is a unique entity, which contains data and functions (characteristics and behavior) together in an Object-Oriented Programming (OOP) Language.
Define: A class is simply
a representation of the type of objects. It is the blueprint/ plan/ template
that describes the details of an object. A class is a blueprint from which the
individual objects are created. Class is composed of three things viz. a name,
attributes and operations.
Define: Wrapping of data
and functions of a class together so that they can be applied as a unit to
perform any operation is termed as Encapsulation.
Define: Abstraction
refers to an act of representing essential features without including
background details.
Define: Inheritance is
the process in which objects of one class can link and share some common
properties of the objects with another class.
Define: Polymorphism is
the process of using a function for more than one purpose. It allows the use of
the different internal structures of the object by keeping the same external
interface.
Define: Dynamic binding
is the process that links the function call with function signature at runtime,
i.e., during the execution of a program.
Benefits of the Object-Oriented Programming (OOP)
There are many benefits of OOP to the programmers
as well as the users. Some benefits of OOP are listed below:
·
You
can extend the use of an existing class through inheritance.
·
Using
the concept "data hiding," you can generate a secured program.
·
Multiple
instances of an object can be created to co-exist without any interference.
·
You
can create different modules in your project through objects.
·
It
is highly beneficial for solving complex problems.
· It is easy to modify and maintains software complexity.
By: Aaditya Rasala
Currently pursuing B.E. in Computer
Engineering as professional life. with a bit of interest in photography,
adventure, and learning new stuff.
you can find me on
Twitter: https://twitter.com/i_am_avr
LinkedIn: https://www.linkedin.com/in/aaditya-rasala-a53a641a0/
join community: https://www.facebook.com/groups/2774342266129184/about/
Great work..keep it up
ReplyDelete👌👌👌
ReplyDelete