Core Java Report PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

An Industrial Training Report

on

“Core Java​”
Submitted in Partial Fulfillment of the Requirement for the Degree of
BACHELOR OF TECHNOLOGY
In
Computer science & Engineering

Under the Supervision of


Mr. Sriyank Siddhartha

By
Ashish Kumar (1609110027)
Submitted To
Ms. Rashmi Prasanna

JSS ACADEMY OF TECHNICAL EDUCATION, NOIDA


DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Dr. Abdul Kalam Technical University, Lucknow
Session: - 2019-2020
DECLARATION

This is to certify that the Project Report Entitled “​Core Java​” which is being submitted in
partial fulfillment of the requirement for the award of technical training certificate during
degree B. Tech in Computer Science and Engineering to JSSATE, Noida (Dr. A.P.J. Abdul
Kalam Technical University, Lucknow) comprises only original work and studies carried out
by the students themselves.

Date:04/12/2019

Ashish Kumar (1609110027)

Approved By:

Sriyank Siddhartha

Project Supervisor
Chapter 1 INTRODUCTION

1.1 Definition 1

1.2 Categories of Java 2

1.2.1 JS2E 2

1.2.2 J2EE 2

1.2.3 J2ME 3

1.3 Basics of Java 3

1.4 A Java Program: From Birth to Execution 5

1.5 Types of java applications 5

Chapter 2 TOOLS AND TECHNOLOGY USED

2.1 Java 7

2.2 JavaFx 8

2.3 IntelliJ IDEA 9

Chapter 3 HISTORY AND FEATURES OF TECHNOLOGY USED

3.1 History of the technology used 11


3.2 Feature of Technology used 13

3.3 Need and added features of the technologies 18

Chapter 4 WORK DONE

4.1 Problem Statement 20

4.2 Snapshots 2​1

Chapter 5 CONCLUSION AND FUTURE SCOPE

5.1 Future Aspects of Project 28

5.2 Industrial Relevance 28

5.3 Societal Relevance 29

5.4 Future Scope of Project 29

REFERENCES 30
VISION AND MISSION
VISION OF THE INSTITUTE

JSS A​cademy of ​T​echnical ​E​ducation Noida aims to become an Institution of


excellence in imparting quality ​O​utcome ​B​ased ​E​ducation that empowers the young
generation with ​K​nowledge, ​S​kills, Research, ​A​ptitude and ​E​thical values to solve
Contemporary Challenging Problems.

MISSION OF THE INSTITUTE

D​evelop a platform for achieving globally acceptable level of intellectual acumen and
technological competence. ​C​reate an inspiring ambience that raises the motivation level
for conducting quality research .​P​rovide an environment for acquiring ethical values
and positive attitude

VISION OF THE DEPARTMENT

“To spark the imagination of the Computer Science Engineers with values, skills
and creativity to solve real world problems.”

MISSION OF THE DEPARTMENT

To inculcate creative thinking and problem solving skills through effective


teaching, learning and research.
To empower professionals with core competency in the field of Computer Science
and Engineering.
To foster independent and lifelong learning with ethical and social responsibilities.
COURSE OUTCOMES (COs)

C411.1 To adapt with real life working environment.

C411.2 To acquire skills and knowledge on latest tools and technologies.


C411.3 To solve the real world problems effectively.
C411.4 To effectively communicate solution to problems through technical reports and
oral presentations

PROGRAM OUTCOMES (POs)

Engineering Graduates will be able to:


PO1: Engineering knowledge​: Apply knowledge of mathematics, science,
engineering fundamentals, and an engineering specialization to the solution of complex
engineering problems.
PO2: Problem analysis​: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering sciences.
PO3: Design/development of solutions​: Design solutions for complex engineering
problems and design system components or processes that meet specified needs with
appropriate consideration for public health and safety, and the cultural, societal, and
environmental considerations.
PO4: Conduct investigations of complex problems​: Use research-based knowledge
and research methods including design of experiments, analysis and interpretation of
data, and synthesis of the information to provide valid conclusions.
PO5: Modern tool usage​: Create, select, and apply appropriate techniques, resources,
and modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
PO6: The engineer and society​: Apply reasoning informed by the contextual
knowledge to assess societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to the professional engineering practice.
PO7: Environment and sustainability​: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.
PO8: Ethics​: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
PO9: Individual and team work​: Function effectively as an individual, and as a
member or leader in diverse teams, and in multidisciplinary settings.
PO10: Communication​: Communicate effectively on complex engineering activities
with the engineering community and with society at large, such as being able to
comprehend and write effective reports and design documentation, make effective
presentations, and give and receive clear instructions.
PO11: Project management and finance​: Demonstrate knowledge and understanding
of the engineering and management principles and apply these to one’s own work, as a
member and leader in a team, to manage projects and in multidisciplinary
environments.
PO12: Life-long learning​: Recognize the need for, and have the preparation and
ability to engage in independent and life-long learning in the broadest context of
technological change.

PROGRAM EDUCATIONAL OUTCOMES (PEOs)

PEO1​: To empower students with effective computational and problem solving skills.

PEO2: ​To enable students with core skills for employment and entrepreneurship.

PEO3​: To imbibe students with ethical values and leadership qualities.

PEO4: ​To foster students with research oriented ability which helps them in
analyzing and solving real life problems and motivate them for pursuing higher
studies.

PROGRAM SPECIFIC OUTCOMES (PSOs)

PSO1: An ability to apply foundation of Computer Science and Engineering,


algorithmic principles and theory in designing and modeling computation based
systems.
PSO2: The ability to demonstrate software development skills
CO-PO-PSO MAPPING

P PO PO PO PO PO PO PO PO PO1 PO1 PO1 PSO PSO


O1 2 3 4 5 6 7 8 9 0 1 2 1 2

C411.
2 2 2 2 3 3 3 3 3 3 2 3 3 2
1
C411.
3 2 2 2 3 1 1 3 2 2 1 3 3 3
2
C411.
3 3 2 2 2 3 3 3 3 2 1 3 3 3
3
C411.
3 3 2 2 2 2 2 3 3 3 2 3 3 3
4
Acknowledgement

I would like to express my gratitude and appreciation to all those who gave me the
possibility to complete this report. It would not have been possible without the kind support
and help of many individuals and organizations. I am highly thankful to Internshala Trainings
for their guidance and constant supervision as well as for providing necessary information
regarding the project & also for their support in completing the project. I would like to express
my gratitude towards Mr. Sarvesh Aggarwal, CEO: Internshala, Mr. Sriyank Siddhartha,
course instructor for their kind cooperation and encouragement which helped me in completion
of this project. I would also like to acknowledge with much appreciation the crucial role of my
colleagues whose help, stimulating suggestions and encouragement, helped me in developing
the project.

Name: Ashish Kumar

Roll No.: 1609110027


ABSTRACT

This training has helped me to learn and implement the concepts of core Java. The training
included online video content along with quiz, assignments and module tests to check my
progress. The training program has helped me to walk through all the core java concepts and
implement those concepts. This has increased my theoretical as well as practical knowledge
by creating various projects like a temperature converter desktop application and a Java game
( cross-platform desktop application ) from scratch using the JavaFX platform. Thus covering
not only core java but also GUI based JavaFX platform for creating games.
About Company

Internshala is a ​dot com​ business with the heart of dot org.

They are a technology company on a mission to equip students with relevant skills & practical
exposure through internships and online trainings. Imagine a world full of freedom and
possibilities. A world where you can discover your passion and turn it into your career. A
world where your practical skills matter more than your university degree. A world where you
do not have to wait till 21 to taste your first work experience (and get a rude shock that it is
nothing like you had imagined it to be). A world where you graduate fully assured, fully
confident, and fully prepared to stake claim on your place in the world.

Internshala is an internship and online training platform, based out of Gurgaon,India.


Founded by Sarvesh Agrawal, An IIT Madras alumnus, in 2010, the website helps students
find internships with organisations in India.
TABLE OF CONTENTS

Sno. TOPIC PAGE No.

1 Cover Page i

2 Certificate ii

3 Declaration by Student iii

4 Vision, Mission, PEO v

5 PO vii

6 PSO, CO, CO-PO-PSO Mapping vii

7 Acknowledgement ix

8 Abstract x

9 About Company xi

10 List of Figures xii

11 List of Abbreviations xiv


Sno. Page no.
TOPIC
1 Chapter 1: Introduction 1-7

1.1 Definition 1-2

1.2 Types of Network 3-4

1.3 Network Models 5

1.3.1 Layering concepts and benefits 5

1.3.2 OSI Network model 5

2 Chapter 2: Tools and Technologies Used 8-13

2.1 Vmware Workstation Pro(12.0.0) 8

2.2 Webmin-1.330-1.noarch 10

3 Chapter 3: History of Technology 14-19

3.1 History of Technology used 14

3.2 Feature of Technology used and need 15-19

4 Chapter 4: Work Done 20-33

4.1 Problem Statement 20

4.2 Snapshots 23

5 Chapter 5: Conclusion and Future Scope 34-37

6 REFERENCES 38
LIST OF FIGURES

S.NO TITLE PAGE.NO

Figure 4.2.1 Layouts 21

Figure 4.2.2 Layout Fundamental 22

Figure 4.2.3 Menu Bar 22

Figure 4.2.4 Temperature Converter Tool 23

Figure 4.2.5 Converted Temperature 23

Figure 4.2.6 Connect Four Game Layout 24

Figure 4.2.7 Adding Menu Bar in Connect Four Game 24

Figure 4.2.8 Creating Hole in Background 25

Figure 4.2.9 Insert Disc in Background 25

Figure 4.2.10 Adding Logic in Game 26

Figure 4.2.11 Winning Criteria 26

Figure 4.2.12 Final Game Output 27


LIST OF ACRONYMS

1. JVM Java Virtual Machine

2. JDK Java Development Kit

3. JRE Java Runtime Environment

4. J2SE Java 2 Standard Edition

5. J2EE Java 2 Enterprise Edition

6. J2ME Java 2 Mobile Edition

7. JIT Just-in-time

8. API Application Programming Interface

9. GUI Graphical User Interface

10. AWT Abstract Window Toolkit

11. JSP Java Server Pages

12. IDE Integrated development environment

13. SDK Software Development Kit

14. HTTP Hyper Text Transfer protocol

15. HTML Hypertext Markup Language

16. CSS Cascading Style Sheets


​CHAPTER I

INTRODUCTION

This training was completed in modules and it took 6 weeks to complete it. There were a total
of 4 modules. The first module was comprised of setting up the environment and basic
introduction of java. The second module was named leveraging basic concepts and included
topics like arrays, strings, methods, exception handling, etc. The third section was comprised
of object-oriented programming concepts such as classes and objects, inheritance,
polymorphism, constructors, getter and setters and some other concepts like interfaces,
collections, file handling, etc. The final part of the training was the project.

The main aim of doing this project was to get familiar with basic concepts of java and learn
how to use those concepts in real world applications such as development of games and
desktop applications. The purpose of the final project is to help students to enhance their
knowledge and implement whatever they have learned. The project has two parts to it. The
first part includes the development of a basic desktop application used to convert the
temperature entered by the user in fahrenheit to celsius and vice-versa. The second part of the
project is the development of a game i.e. Connect 4 game.

This project helped me a lot in gaining the concepts of core java increased my practical as
well as theoretical knowledge. I also learn how to develop GUI using the JavaFX. I also
gained some experience while working in IntelliJ IDEA which helped me learn a lot of tips
and tricks which can be very handy in faster and efficient development of applications. This
training allowed me to increase my knowledge in Java and JavaFX with which we had many
difficulties. The main positives of this project were getting familiar with the concepts of
object oriented programming and how to develop desktop applications using Java and
JavaFX.This training allowed me to increase my knowledge in Java and JavaFX with which
we had many difficulties.
The main goal of the project was to clear the following concepts related to java :

1.1 Definition :-
Java is one of the programming language or technology used for developing web applications.
Java language was developed at SUN Micro Systems in the year 1995 under the guidance of
James Gosling and his team. Gosling was the first designer of the Java programming
language and implemented its original compiler and virtual machine.

1.2 Categories of Java :-


There are three categories of java which are -
1. JS2E (Java 2 Standard Edition) - ​Also known as Core Java, this is the most basic
and standard version of Java.It’s the purest form of Java, a basic foundation for all
other editions. It consists of a wide variety of general purpose API’s (like
java.lang, java.util) as well as many special purposes APIs J2SE is mainly used to
create applications for Desktop environment. It consists of all the basics of Java
language, variables, primitive data types, Arrays, Streams, Strings Java Database
Connectivity(JDBC) and much more. This is the standard, from which all other
editions came out, according to the needs of the time. The famous JVM of Java,
the heart of Java development, was also given by this edition only.It’s because of
this feature, that Java has such a wide usage.

2. J2EE (Java 2 Enterprise Edition) - ​The Enterprise version of Java has a much
larger usage of Java, like development of web services, networking, server side
scripting and other various web based applications. J2EE is a community driven
edition, i.e. there is a lot of continuous contributions from industry experts, Java
developers and other open source organizations. J2EE uses many components of
J2SE, as well as, has many new features of it’s own like Servlets, JavaBeans, Java
Message Services, adding a whole new functionalities to the language. J2EE uses
HTML, CSS, JavaScript etc. so as to create web pages and web services. It’s also
one of the most widely accepted web development standards.
3. J2ME (Java 2 Micro or Mobile Edition) - ​J2ME is used for developing mobile
or wireless application by making use of a predefined protocol called WAP
(wireless Access / Application protocol).This version of Java is mainly
concentrated for the applications running on embedded systems, mobiles and small
devices.(which was a constraint before it’s development) Constraints included
limited processing power, battery limitations, small display etc. Also, the J2ME
apps help in using web compression technologies, which in turn, reduce network
usage, and hence cheap internet accessibility. J2ME uses many libraries and API’s
of J2SE, as well as, many of it’s own. The basic aim of this edition was to work on
mobiles, wireless devices, set top boxes etc. Old Nokia phones, which used
Symbian OS, used this technology. Most of the apps developed for the
phones(prior to smartphones era), were built on J2ME platform only(the .jar apps
on Nokia's app store).

1.3 Basics of Java :-


Java Runtime Environment (JRE)
It is part of the Java Development Kit (JDK). It contains a set of libraries and tools for
developing java application. The Java Runtime Environment provides the minimum
requirements for executing a Java application. It physically exists. It contains set of libraries +
other files that JVM uses at runtime.

Java Virtual Machine (JVM)


JVM is set of programs developed by sun Micro System and supplied as a part of jdk for
reading line by line of byte code and it converts into native understanding form of operating
system. JVM (Java Virtual Machine) is a software. It is a specification that provides runtime
environment in which Java bytecode can be executed. It not physically exists. JVMs are not
the same for all hardware and software, for example for window os JVM is different and for
Linux JVM is different. Java language is one of the compiled and interpreted programming
languages.
Java Development Kit (JDK)
The Java Development Kit (JDK) is primary components. It physically exists. It is collection
of programming tools and JRE, JVM.

Difference Between JDK,JRE AND JVM


JVM, JRE, JDK these all the backbone of java language. Each components have separate
works. JDK and JRE physically exists but JVM are abstract machine it means it not physically
exists. JVM, JRE and JDK are platform dependent because configuration of each OS differs.
But, Java is platform independent.

JavaFX
It is another edition of Java technology, which is now merged with J2SE 8.It is mainly used to
create rich GUI (Graphical User Interface) in Java apps.It replaces Swings (in J2SE), with
itself as the standard GUI library. It is supported by both Desktop environment as well as web
browsers.

Garbage Collector
Garbage Collector is the system Java program which runs in the background along with
regular Java program to collect un-referenced (unused) memory space for improving the
performance of our applications.

Application Programming Interface (API)


API is a collection of packages, a package is a collection of classes, interfaces and
sub-packages. A sub-package is a collection of classes interfaces and sub sub packages etc.
Java programming is containing user friendly syntax so that we can develop effective
applications. in other words if any language is providing user friendly syntax, we can develop
error free applications.
JIT
JIT is the set of programs developed by SUN Micro System and added as a part of JVM, to
speed up the interpretation phase.

1.4 A Java Program: From Birth to Execution


1. ​ ​Coding​: Human-readable Java code is produced by the programmer.

2. Building​: A Java Development Tool builds the Java program into byte-code,
which is saved as a ". class" file.

3. Loading​: Via the web or command line, the class file is sent to the Java Virtual
Machine (VM) with an attached digital signature. The Java VM is simply an interpreter.

4. Bytecode Verification​: The Java VM verifies the digital signature. When


downloaded remotely, the Java VM isolates the Java program in a restricted part of
memory. The Java program is not allowed to access local Hard drives and System
resources.

5. Internal Integrity​: Verification checks are made to insure that the loaded Java
program is well formed. Data types are verified along with other syntax structure.

6. Execution​: Program execution begins.

1.5 Types of java applications :-

There are four types of Java applications that can be created using Java programming:

● Standalone Applications: Java standalone applications uses GUI components


such as AWT, Swing, and JavaFX. These components contain buttons, list, menu,
scroll panel, etc. It is also known as desktop alienations.
● Enterprise Applications: An application which is distributed in nature is called
enterprise applications.
● Web Applications: An applications that run on the server is called web
applications. We use JSP, Servlet, Spring, and Hibernate technologies for creating
web applications.
● Mobile Applications: Java ME is a cross-platform to develop mobile applications
which run across smartphones. Java is a platform for App Development in
Android.
Chapter 2

Tools and Technology Used

2.1 Java:
Java is a programming language and environment invented by James Gosling and others in
1994. Java was originally named Oak and was developed as a part of the Green project at the
Sun Company. Java is an object-oriented programming language with a built-in application
programming interface (API) that can handle graphics and user interfaces and that can be
used to create applications or applets. Because of its rich set of API's, similar to Macintosh
and Windows, and its platform independence, Java can also be thought of as a platform in
itself. Java also has standard libraries for doing mathematics.

Java is the same as C and C++. One major difference is that Java does not have pointers.
However, the biggest difference is that you must write object oriented code in Java.
Procedural pieces of code can only be embedded in objects. In the following we assume that
the reader has some familiarity with a programming language.

In particular, some familiarity with the syntax of C/C++ is useful.In Java we distinguish
between applications, which are programs that perform the same functions as those written in
other programming languages, and applets, which are programs that can be embedded in a
Web page and accessed over the Internet. Our initial focus will be on writing applications.
When a program is compiled, a byte code is produced that can be read and executed by any
platform that can run Java.

Java is one of the most popular programming languages used to create Web applications and
platforms. It was designed for flexibility, allowing developers to write code that would run
on any machine, regardless of architecture or platform. According to the Java home page,
more than 1 billion computers and 3 billion mobile phones worldwide run Java.
Why Java :
Java is preferred over other programming languages because of the following reasons -

● Java is Easy to learn


● Java is an Object Oriented Programming Language
● Java has Rich API
● Powerful development tools e.g. IntelliJ, Eclipse, Netbeans
● Great collection of Open Source libraries
● Wonderful Community Support
● Excellent documentation support - Javadocs
● Java is Platform Independent
● Java is secure

2.2 JavaFX :
JavaFX is a Java library used to build Rich Internet Applications. The applications written
using this library can run consistently across multiple platforms. The applications developed
using JavaFX can run on various devices such as Desktop Computers, Mobile Phones, TVs,
Tablets, etc. To develop GUI Applications using the Java programming language, the
programmers rely on libraries such as Advanced Windowing Toolkit and Swing.

After the advent of JavaFX, these Java programmers can now develop GUI applications
effectively with rich content. To develop Client Side Applications with rich features, the
programmers used to depend on various libraries to add features such as Media, UI controls,
Web, 2D and 3D, etc. JavaFX includes all these features in a single library. In addition to
these, the developers can also access the existing features of a Java library such as Swing.
JavaFX provides a rich set of graphics and media API’s and it leverages the modern
Graphical Processing Unit through hardware accelerated graphics. JavaFX also provides
interfaces using which developers can combine graphics animation and UI control.

One can use JavaFX with JVM based technologies such as Java, Groovy and JRuby. If
developers opt for JavaFX, there is no need to learn additional technologies, as prior
knowledge of any of the above-mentioned technologies will be good enough to develop
RIA’s using JavaFX.
Why JavaFX :
Swing ​can be used in place of JavaFX but due to following advantages JavaFX is considered -
● FXML
● Scene BuilderSwing Interoperability
● Built-in UI controls
● CSS like Styling
● Integrated Graphics library
● Graphics pipeline
● Canvas and Printing API

2.3 IntelliJ IDEA:

IntelliJ IDEA is a special programming environment or integrated development environment


(IDE) largely meant for Java. This environment is used especially for the development of
programs. It is developed by a company called JetBrains, which was formerly called IntelliJ.
It is available in two editions: the Community Edition which is licensed by Apache 2.0, and a
commercial edition known as the Ultimate Edition. Both of them can be used for creating
software which can be sold. What makes IntelliJ IDEA so different from its counterparts is its
ease of use, flexibility and its solid design. IntelliJ IDEA was developed by JetBrains,
formerly known as IntelliJ.

It was first released in 2001, and it boasted features like advanced code navigation and the
ability to refactor code, which made it very popular. It even received the distinction of being
voted the best programming tool based on Java in 2010, sidelining established tools like
NetBeans, Eclipse and JDeveloper.

The open-source development environment for Android released by Google in 2014 is also
based on IntelliJ IDEA.The IDE supports many other programming languages such as
Python, Lua and Scala. The biggest reason it is regarded as one of the best programming tools
based on Java is its assistance features, which makes it easy to use and makes the programs
created by it very well designed. It also has advanced error checking features which allows
faster and easier error checking.
Why IntelliJ IDEA :

Instead of IntelliJ, other IDEs could also be used in this project such as ​Eclipse​, ​NetBeans​,
etc.

Intellij IDEA is considered because of the following features -


● Smart Code Completion
● On-The-Fly Code Analysis
● Advanced Refactoring
● Detecting Duplicates
● Inspection and Quick Fixes
● Shortcuts for Everything
● Terminal
● Navigation and Search
● Tools and Frameworks Support
● Application Server
CHAPTER 3

History and features of the technology used

3.1 History of the technology used:

Java : ​Java is an Object-Oriented programming language developed by James Gosling in the


early 1990s. The team initiated this project to develop a language for digital devices such as
set-top boxes, television, etc. Originally ​C++ was considered to be used in the project but the
idea was rejected for several reasons(For instance C++ required more memory). Gosling
endeavoured to alter and expand ​C++ however before long surrendered that for making
another stage called Green. James Gosling and his team called their project “Greentalk” and
its file extension was .gt and later became known as “OAK”.The name Oak was used by
Gosling after an oak tree that remained outside his office. Also, Oak is an image of solidarity
and picked as a national tree of numerous nations like the U.S.A., France, Germany,
Romania, etc. But they had to later rename it as “JAVA” as it was already a trademark by
Oak Technologies.

Gosling and his team did a brainstorm session and after the session, they came up with
several names such as JAVA, DNA, SILK, RUBY, etc.Java name was decided after much
discussion since it was so unique. The name Java originates from a sort of espresso bean,
Java. Gosling came up with this name while having a coffee near his office.Java was created
on the principles like Robust, Portable, Platform Independent, High Performance,
Multithread, etc. and was called one of the Ten Best Products of 1995 by the TIME
MAGAZINE.

Currently, Java is used in internet programming, mobile devices, games, e-business solutions,
etc. The ​java language has experienced a few changes since JDK 1.0 just as various
augmentations of classes and packages to the standard library. In Addition to the language
changes, considerably more sensational changes have been made to the Java Class Library
throughout the years, which has developed from a couple of hundred classes in JDK 1.0 to
more than three thousand in J2SE 5.

Versions of JAVA -
Many java versions have been released till now. The current stable release of Java is Java SE
10.

1. JDK Alpha and Beta (1995)


2. JDK 1.0 (23rd Jan 1996)
3. JDK 1.1 (19th Feb 1997)
4. J2SE 1.2 (8th Dec 1998)
5. J2SE 1.3 (8th May 2000)
6. J2SE 1.4 (6th Feb 2002)
7. J2SE 5.0 (30th Sep 2004)
8. Java SE 6 (11th Dec 2006)
9. Java SE 7 (28th July 2011)
10. Java SE 8 (18th March 2014)
11. Java SE 9 (21st Sep 2017)
12. Java SE 10 (20th March 2018)

JavaFX : ​JavaFX Script, the scripting component of JavaFX, began life as a project by Chris
Oliver called F3.Sun Microsystems first announced JavaFX at JavaOne Worldwide Java
Developer conference on May 2007. In May 2008 Sun Microsystems announced plans to
deliver JavaFX for the browser and desktop by the third quarter of 2008, and JavaFX for
mobile devices in the second quarter of 2009. Sun also announced a multi-year agreement
with On2 Technologies to bring comprehensive video capabilities to the JavaFX product
family using the company's TrueMotion Video codec.
Since the end of July 2008, developers could download a preview of the JavaFX SDK for
Windows and Macintosh, as well as the JavaFX plugin for NetBeans 6.1. Major releases since
JavaFX 1.1 have a release name based on a street or neighborhood in San Francisco. Update
releases typically do not have a release name. Oracle announced their intention to stop
shipping JavaFX with JDK 11 and later, and it's no longer bundled with the latest version.
IntelliJ IDEA : ​IntelliJ IDEA[1] first version released in January 2001, and it was one of the
first available Java IDEs with advanced code navigation and code refactoring potential
integrated. In a 2010 IntelliJ received the highest test center score out of the top four Java
programming tools, Eclipse, IntelliJ IDEA, JDeveloper and NetBeans. In December 2014,
Google announced an Android Studio version 1.0, an open source IDE for Android apps,
which is based on the open source community edition of the IntelliJ IdEA. Other software
environments based on IntelliJ framework include AppCode, PhpStorm, Clion, RubyMine,
MPS, and PyCharm.

3.2 Features of the technology used:

Java:

1. Platform Independence

The concept of Write-once-run-anywhere (known as the Platform independent) is one


of the important key features of the Java language that makes java as the most powerful
language. Not even a single language is idle to this feature but java is more closer to
this feature. The programs written on one platform can run on any platform provided
the platform must have the JVM.

2. Simple

There are various features that makes the java as a simple language. Programs are easy
to write and debug because java does not use the pointers explicitly. It is much harder
to write the java programs that can crash the system but we can not say about the other
programming languages. Java provides the bug free system due to the strong memory
management. It also has the automatic memory allocation and deallocation system.

3. Object Oriented

To be an Object Oriented language, any language must follow at least the four
characteristics.

1. Inheritance​: It is the process of creating the new classes and using the
behavior of the existing classes by extending them just to reuse the existing
code and adding the additional features as needed.
2. Encapsulation​: It is the mechanism of combining the information and
providing the abstraction.
3. Polymorphism : As the name suggest one name multiple form, Polymorphism
is the way of providing the different functionality by the functions having the
same name based on the signatures of the methods.
4. Dynamic binding ​: Sometimes we don't have the knowledge of objects about
their specific types while writing our code. It is the way of providing the
maximum functionality to a program about the specific type at runtime.

4. Robust

Java has the strong memory allocation and automatic garbage collection mechanism. It
provides the powerful exception handling and type checking mechanism as compared
to other programming languages. Compiler checks the program whether there any error
and interpreter checks any run time error and makes the system secure from crash. All
of the above features makes the java language robust.

5. Distributed

The widely used protocols like HTTP and FTP are developed in java. Internet
programmers can call functions on these protocols and can access the files from any
remote machine on the internet rather than writing codes on their local system.

6. Portable

The feature Write-once-run-anywhere makes the java language portable provided that
the system must have an interpreter for the JVM. Java also have the standard data size
irrespective of operating system or the processor. These features make the java as a
portable language.

7. Performance

Java uses native code usage, and lightweight process called threads. In the beginning
the interpretation of bytecode resulted the performance slow but the advance version of
JVM uses the adaptive and just in time compilation technique that improves the
performance.
8. Multithreaded

Java is a Multithreaded programming language. Multithreading means a single program


having different threads executing independently at the same time. Multiple threads
execute instructions according to the program code in a process or a program.
Multithreading works the similar way as multiple processes run on one computer.
Multithreading programming is a very interesting concept in Java. In multithreaded
programs not even a single thread disturbs the execution of other threads. Threads are
obtained from the pool of available ready to run threads and they run on the system
CPUs.

9. Interpreted & Compiler

We all know that Java is an interpreted language as well. With an interpreted language
such as Java, programs run directly from the source code. The interpreter program reads
the source code and translates it on the fly into computations. Thus, Java as an
interpreted language depends on an interpreter program.The versatility of being
platform independent makes Java to outshine from other languages. The source code to
be written and distributed is platform independent. Another advantage of Java as an
interpreted language is its error debugging quality. Due to this any error occurring in
the program gets traced. This is how it is different to work with Java.

10. Architecture Neutral

The term architectural neutral seems to be weird, but yes Java is an architectural neutral
language as well. The growing popularity of networks makes developers think
distributed. In the world of network it is essential that the applications must be able to
migrate easily to different computer systems. Not only to computer systems but to a
wide variety of hardware architecture and Operating system architectures as well. The
Java compiler does this by generating byte code instructions, to be easily interpreted on
any machine and to be easily translated into native machine code on the fly.

JavaFX:
JavaFX 2.2 and later releases have the following features:
● Java APIs​. JavaFX is a Java library that consists of classes and interfaces that are
written in native Java code. The APIs are designed to be a friendly alternative to Java
Virtual Machine (Java VM) languages, such as JRuby and Scala.

● FXML and Scene Builder​. FXML is an XML-based declarative markup language for
constructing a JavaFX application user interface. A designer can code in FXML or use
JavaFX Scene Builder to interactively design the graphical user interface (GUI). Scene
Builder generates FXML markup that can be ported to an IDE where a developer can
add the business logic.

● WebView​. A web component that uses WebKitHTML technology to make it possible


to embed web pages within a JavaFX application. JavaScript running in WebView can
call Java APIs, and Java APIs can call JavaScript running in WebView.

● Swing interoperability​. Existing Swing applications can be updated with new JavaFX
features, such as rich graphics media playback and embedded Web content.

● Built-in UI controls and CSS​. JavaFX provides all the major UI controls required to
develop a full-featured application. Components can be skinned with standard Web
technologies such as CSS

● Canvas API​. The Canvas API enables drawing directly within an area of the JavaFX
scene that consists of one graphical element (node).

● Multitouch Support​. JavaFX provides support for multitouch operations, based on the
capabilities of the underlying platform.

● Hardware-accelerated graphics pipeline​. JavaFX graphics are based on the graphics


rendering pipeline (Prism). JavaFX offers smooth graphics that render quickly through
Prism when it is used with a supported graphics card or graphics processing unit
(GPU). If a system does not feature one of the recommended GPUs supported by
JavaFX, then Prism defaults to the Java 2D software stack.
● High-performance media engine​. The media pipeline supports the playback of web
multimedia content. It provides a stable, low-latency media framework that is based on
the GStreamer multimedia framework.

● Self-contained application deployment model​. Self-contained application packages


have all of the application resources and a private copy of the Java and JavaFX
runtimes. They are distributed as native installable packages and provide the same
installation and launch experience as native applications for that operating system.

IntelliJ IDEA:
Some of the great features of IntelliJ IDEA are:

● Smart Code Completion ​- It is a set of techniques used to analyse the pieces of code
to the developer. It supports context-based completion. It can detect and differentiate
between big quantity of languages such as Java, JavaScript, Scala, SQL etc.
● On-The-Fly Code Analysis - It helps to improve our code by identifying that an
expression is valid or not and gives the compilation error if any. This feature will
always analyse our source code regularly in the background which identifies the errors
and provides possible improvements.
● Advanced Refactoring - Refactoring process is a modification to the file. IntelliJ
IDEA has a big range of refactoring option. It helps the developers to refactor his code
faster and in a more secure manner. IntelliJ IDEA automatically suggests the
refactoring. If it doesn't propose any refactoring option then we can select it from the
refactor menu.
● Detecting Duplicates - It helps to find the duplicate code fragments and provides the
suggestion to the user.
● Inspection and Quick Fixes - When IntelliJ IDEA detects a mistake, a little light bulb
pops up in the editor. When you click it, it opens a list of actions which can take to
make things right.
● Shortcuts for Everything - IntelliJ IDEA provides a keyboard shortcuts for most of
the things including rapid selection and switching between tool windows and the
editor.
● Terminal​ - The IntelliJ IDEA IDE comes with a built-in terminal.
● Navigation and Search - It is one of the great characteristics of IntelliJ IDEA which
helps in finding and navigating to a resource. It can search all the controls that exist in
the IDE. In this, we can navigate to a declaration from a usage and a usage from a
declaration. It is also possible to find elements in places where we cant find any
search. In this, we can use a regular expression to find and replace method.
● Tools and Frameworks Support - IntelliJ provides support for many different tools
which helps in developing our application. It helps the developers to focus and reduce
some reworks in the IDE. It supports a very advanced type of frameworks like Struts,
Spring, Hibernate, Play, Grails etc. with the integration of different tools. It makes
development very simple.
● Application Server - IntelliJ IDEA supports many application servers. These servers
are - Tomcat, JBoss, WebSphere, WebLogic, Glassfish, and many others. We can
deploy our projects onto the application servers and debug that applications right from
within the IDE.

3.3 Need and added features of the technologies:

Java :

Hardware Requirements

● 200 MHz Pentium, 160 MHz PowerPC, or 166 MHz UltraSparc


● At least 64 MB RAM
● 486 or Pentium based PC (Pentium 100MHz or better recommended).
● Display card supporting 8, 16, 24 or 32 bit display mode. (16-bit display mode
recommended for fastest video performance).
● Optional: A SoundBlaster-compatible sound card for Windows machines without
built-in audio support.

Software Requirements

● JDK 1.1.5 or later from Sun. (Tested on 1.1.5, 1.1.6, 1.1.7, and the Java 2 platform)
Use of a JIT is strongly recommended. JDK 1.1.6 or later is required for Y2K
compatibility.
● Java 2 or JDK 1.x with Swing 1.1 or above to run JMFCustomizer.
● JMF classes (included in this release).
● Optional: Microsoft Internet Explorer 4.01 or later.
● Windows 95/98 or Windows NT 4.

IntelliJ IDEA:
Hardware requirements

● 1 GB RAM minimum, 2 GB RAM recommended


● 300 MB hard disk space + at least 1 GB for caches
● 1024x768 minimum screen resolution

Software requirements

Windows

● Microsoft Windows 10/8/7/Vista/2003/XP (incl.64-bit)


● To develop Java applications with IntelliJ IDEA, install JDK version
according to your project requirements.

Mac

● macOS 10.5 or higher.


● Only 64-bit macOS is supported.
● To develop Java applications with IntelliJ IDEA, install JDK version
according to your project requirements.

Linux

● OS Linux 64 bit
● KDE, GNOME or Unity DE desktop
● To develop Java applications with IntelliJ IDEA, install JDK version
according to your project requirements.
CHAPTER 4

Work Done

4.1 Problem Statement

The problem statement of this project is the development of two applications. The first one is
the basic utility desktop application and the second one is a platform independent desktop
game. The project has two parts to it. The first part includes the development of a basic
desktop application used to convert the temperature entered by the user in fahrenheit to celsius
and vice-versa. The second part of the project is the development of a desktop game i.e.
Connect 4 game. The following section contains the description of the game and the rules to
be followed.

Connect Four is a two-player connection game in which the players first choose a color and
then take turns dropping colored discs from the top into a seven-column, six-row vertically
suspended grid. The pieces fall straight down, occupying the next available space within the
column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal
line of four of one's own discs. Connect Four is a solved game. The first player can always
win by playing the right moves.

Rules :-

1.The game board has seven columns and six rows.

2. There are 21 Blue and 21 Green discs.

3. One player plays with blue disc, the other with green disc.

4. The discs are inserted at the top of a column, and they will fall down and land on the
bottom (if the column was empty) or on top of a previously inserted disc.

5. Blue starts.

6. Blue and Green take turns.

7. One can only insert discs in one of the seven columns.


8. One cannot insert a disc into a column that is full.

9. A line consists of several discs, either in vertical, horizontal, or diagonal form, which
contain only discs of the same color.

10. A player wins if he or she manages to form a line of four discs of his or her color.

11. The game ends if one of the players wins.

12. The game ends in a tie if none of the two players can make a valid move and none
of the players has won.

The back-end coding part of both the applications is done in Java. The front end part or the
GUI part coding is done using the JavaFX. JavaFx has a special feature i.e. FXML. It is an
XML-based declarative markup language for constructing a JavaFX application user interface.
A designer can code in FXML or use JavaFX Scene Builder to interactively design the
graphical user interface (GUI). I used the GridPane panel in this project to lay out the disks.
GridPane is one of the JavaFX layout panes but it is different from the other pane because it
lays out its children within a flexible grid of rows and columns.

4.2 Snapshots

Figure 4.2.1 Layouts


Figure 4.2.2 Layout Fundamentals

Figure 4.2.3 Menu Bar


Figure 4.2.4 Temperature converter tool

Figure 4.2.5 Converted temperature


Figure 4.2.6 connect 4 game layout

Figure 4.2.7 Adding Menu Bar in Connect 4 game


Figure 4.2.8 Creating Hole in background

Figure 4.2.9 Insert Disc in Background


Figure 4.2.10 Adding logic in game

Figure 4.2.11 Winning Criteria


Figure 4.2.12 Final Game Output
Chapter 5

CONCLUSION AND FUTURE SCOPE


Java is everywhere, in laptops, scientific supercomputers, gaming consoles, mobile phones, etc.
It’s been quoted that there are 9 million Java developers in the world. This lets you know the
demand of Java and its evolution in software development in the future. Java is considered to be
the most reliable tool for developing client/server application. Efficient exploration and
implementing of such functionalities of java has lead to practical challenging research activities
and development of new standards, thereby shrinking the communication gap. Java defined the
client/server architecture and the powerful tool for network. Java offers the real possibility that
most programs can be written in a type-safe language. However, for Java to be broadly useful, it
needs to have more expressive power than it does at present.

5.1 The Future Aspects of this Project covers the recent changes and what’s coming in
the near future for Java. What about the long-term plans for the Java ecosystem? The ongoing
trend is embracing interoperability. Java has opened its doors to partnerships with other
organizations to extend the Java community. OpenJDK and Jakarta EE are two examples of
this interoperability in action. Additionally, future versions of Java will get improved API
integration and support, modular open source libraries and frameworks, and greater attention
to microservices, containers, and mobile devices. Spring, Kotlin, and other frameworks/stacks
will also become increasingly popular for developing new applications. With Java’s new quick
release cycle, expect a lot of changes in the coming years. Java will become more responsive
to emerging trends in development and the needs of its users. This embrace of a quick release
cycle along with extended support for reference builds means Oracle has implemented a
hybrid approach that gets the best of both worlds in terms of stability and flexibility.

5.2 The Industrial relevance of the project is that ​in today’s competitive business world,
organizations are struggling to stand first and get more benefits. In India, Information
technology is the one, which has held the first position for many years with many innovative
trends. It has multiple stream and platforms to develop an application or product. When we
talk of programming languages and technologies, Java is the most popular platform, which is
used to develop several applications for the systems as well as embedded devices like mobile,
laptops, tablets and many more. It is an object oriented programming language and has a
simple object model, as it has derived from C and C++. It provides a virtual machine, which is
accumulated with byte-code and can run on any system.

Java is everywhere: on all platforms and devices and in all countries around the world. It
enables developers to make programs work just about anywhere. And it inspired the evolution
of an incredible technology community. The brilliance of Java is platform independency.
Thanks to the internet and the community spirit around it, so many people have been able to
make a difference, earn a place in the spotlight with their own framework or tool, be
recognized for their contribution, and really influence the Java world.

With time the importance and popularity of Java is on rise as it has the magic in its remarkable
abilities to innovate and morph as the technology landscape changes. It is still the most
pervasive platform, whether you want to use it for developing smart card applications, mobile
applications, or server-side enterprise applications. One cannot think of any programming
language with a more comprehensive set of APIs. It is a great language for beginners to start
out with, and to continue across the curriculum. It is the language of choice for developing
applications for the BlackBerry Smartphone.

Indian IT Industry: What is the future of Java and Java Jobs ?Basically, Java is not just a
Programming language but it is a programming atmosphere to develop and deploy enterprise
applications. It is important for information technology industry to develop and create multiple
web-based or server based applications to enhance the industrial competency. There is huge
scope for this programming language.

If one talks about job opportunities in the field of Java, knowledge of it is required with many
new technologies and roles such as ‘Java-UI Developers’, ’Android Developers’ and many
others. Hence, there are numerous jobs opportunities available in Java, J2EE combining with
other new technologies. These are among the higher paid jobs in the IT industry, as it comes
under software development. One should have proficient skills to get an employment with IT
organizations as many organizations are looking for professionals who can manage multiple
projects in J2EE and augments the industrial efficiency.

5.3 Speaking of the societal relevance, ​Java can be used to create complete
applications that can run on a single computer or be distributed across servers and clients
in a network. As a result, you can use it to easily build mobile applications or run on
desktop applications that use different operating systems and servers, such as Linux or
Windows.

5.4 Coming to future scope of the project​, ​there is no denial to the fact that Java is
the most important thing that happened to the IT industry across the globe after C++. It
has an illustrious journey since its inception and has been the backbone of many new
products and services that have surprised the world. So it becomes even more important
and equally curios to talk about the future of it. As far as the future of Java is concerned,
it will be intertwined with that of agile and lean thinking that will allow the Java
community to continue to innovate and deliver quality systems that address business
needs. I believe that developers have a role to play in this story, by helping to accelerate
the evolution of IT from isolated systems to collaborative development. It is embedded
in many of the world’s important IT systems and is in a good position to play a part in
future innovation. The best part about Java is, its ecosystem is self-sustaining, from
mobility (Android) to middleware (Hadoop), it impacts everything and will continue to
make a big impact in future too.
REFERENCES

[1] Java mother site @ ​https://www.oracle.com/technetwork/java/index.html​.


[2] Java Documentation @ ​https://docs.oracle.com/en/java/index.html
1. Ken Arnold, James Gosling and David Holmes, "The Java Programming Language",
4th ed, 2005. (The defacto standard for Java Language, but does not seem to have
been updated to cover the latest features?!)
2. James Gosling, Bill Joy, Guy Steele and Gilad Bracha, "The Java Language
Specification", 3rd ed, 2005. (The defacto standard for JVM, but does not seem to
have been updated?!)
3. JDK Demos and Samples (to be downloaded @
https://www.oracle.com/technetwork/java/javase/downloads/index.html​).

Books & Online Tutorials

1. The online Java tutorial @ ​https://docs.oracle.com/javase/tutorial/​. (The authoritative


source)
2. Paul Deitel and Harvey Deitel, "Java How to Program, Late Object", latest edition.
(A comprehensive reference for programmers)
3. Y. Daniel Liang, "Introduction to Java Programming", latest edition. (Good text
book for undergraduate Java courses.)

You might also like