Java Full Stack

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

GOVERNMENT COLLEGE OF

ENGINEERING
(Affiliated to DBATU, Lonere)
Dhamangaon Road, Yavatmal-
445106

INDUSTRIAL TRAINING REPORT


ON
“CORE JAVA”
Under the supervision of “Elegant IT”
Duration (7th Aug – 6th Nov)

Submitted by
Samiksha Ajayrao Jadhav 2110121372521

A report submitted in partial fulfilment of the requirement for the Award of Degree of
Bachelor Of Technology,

Department of Electronics and Telecommunication Engineering


Government College of Engineering, Yavatmal
2023-24

1
GOVERNMENT COLLEGE OF
ENGINEERING
(Affiliated to DBATU, Lonere)
Dhamangaon Road, Yavatmal-445106

CERTIFICATE
Certified that the course work entitled “Core Java” is a bona-fide work
Carried out by
Samiksha Ajayrao Jadhav

The report has been approved as it satisfies the academic requirements in respect of
Course work prescribed for the course

…………….. …………
Prof.M.N.Ingole Prof.S.S.Thorat
Guided by Head of Department

Department of Electronics and Telecommunication Engineering


Government College of Engineering, Yavatmal
2023-24

2
ACKNOWLEDGMENT
This opportunity of course was a golden chance for learning the professional Javafull
stack. I have gained a lot of skills during the tenure of this course. I express
mydeepest gratitude and special thanks to my online tutors for giving their precious
time.I have seen this opportunity as a big milestone in my career development. This
course would help me for shaping my career. I will try my best to gain skills and
knowledge inbest possible way and will continue to work on their development.

I would like to thank ‘Pantech Solutions ’ for giving me this platform to complete my
courseand also my professors for guiding me , time to time.

I would also like to thank Dr.P.M.KHODAKE, Principal, Government College of


Engineering, Yavatmal and the people who directly or indirectly helped us in
completing this task successfully.

3
ABSTRACT
This training has helped me to learn and development the concepts of Java. The
training included online video content along with quiz, assignments and module tests
tocheck my progress. The training program has helped me to walk through all thejava
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 scratchusing
the Java FX platform. Thus, covering not only java but also GUI based JavaFX
platform for creating games.

4
INDEX
Certificate
Acknowledgement
Abstract

CHAPRTER 1: INTRODUCTION

CHAPRTER 2: INTRODUCTION TO JAVA PLATFORM

CHAPRTER 3: INSTALLATION OF JAVA

CHAPRTER 4: BASICS: CLASS AND OBJECT

CHAPRTER 5: VARIABLES AND METHODS

CHAPTER 6: TYPES OF JAVA POLYMORPHISM

CHAPTER 7: JAVA ARRAYS

CHAPTER 8: TYPES OF OPERATORS IN JAVA

CONCLUSION

5
CHAPTER 1
 INTRODUCTION

1.1 Introduction to Java

With the invention of microprocessors, the world is scientifically developed with


sophisticated equipment, systems, and devices. Microprocessors are used in
computers, televisions, and fax machines. Even the hand-held devices such as pagers,
PDAS (Personal Digital Assistant), and cell phones make use of microprocessors. All
these electronic devices are helpful because of their communication capabilities. With
the increasing capabilities and decreasing cost of information processing and
networking technologies, the network is growing rapidly for transmitting information
through electronic systems.

Fig. Java
Internet is the network of networks between different types of computers located at
different places to transmit information. Information can reach to any place in the
world quickly at a cheaper rate through the Internet. Thus, the Internet has made the
world a global village for information exchange. The emerging infrastructure of
electronic devices and interconnected computer networks create an environment that
presents new challenges to software industries. for this emerging computing
environment, Java process to be a well-suited programming language, it is found
suitable for networked environments involving a great variety of computer and
devices.
Java has many characteristics that have contributed to its popularity:

> Platform independence - Many languages are compatible with only one platform.
Java

was specifically designed so that it would run on any computer, regardless if it was
running Windows, Linux, Mac, Unix or any of the other operating systems.

> Simple and easy to use - Java's creators tried to design it so code could be written
efficiently and easily.

> Multi-functional - Java can produce many applications from command-line

6
programs to applets to Swing windows (basically, sophisticated graphical user
interfaces).

7
CHAPTER 2
 INTRODUCTION TO JAVA PLATFORM

Fig. Introduction To Java Platform

2.1 The Java Platform


One thing that distinguished Java from some other languages is hairy the same
compiled code across multiple operating systems in or the source code (code that is
written by the programmes is compiled by compiler into an executable file. This file is
in machine language dis intended for a single operating system processor combination
programmer would have to re-compile the program generally for dis operating
system/processor combination Java is different in that does compile the code directly
into machine language code. Compilation as bytecode out of the source code.
Bytecode generally looks something a7 £4 73 5a Ib 92 7d

When the code is run by the user, it is processed by something called for Virtual
Machine (JVM). The JVM is essentially an interpreter for It goes through the bytecode
and runs it. There are different anions of JVM that are compatible with each OS and
can run the same code. Thes virtually no difference for the end-user, but this makes
are programmers doing software development.

2.2 Java and Open Source:-

In 2006 Sun started to make Java available under the GNU General Public License
(GPL). Oracle continues this project called OpenJDK

2.3 Java Virtual machine :-

The Java virtual machine (JVM) is a software implementation of a computer that


executes programs like a real machine. The Java virtual machine is written specifically
for a specific operating system, e. g. for Linux a special implementation is required as
well as for Windows.
Java programs are compiled by the Java compiler into bytecode. The Java virtual
machine interprets this bytecode and executes the Java program

8
2.4 Java Runtime Environment vs. Java Development Kit
A Java distribution comes typically in two flavours, the Java Runtime Environment
(JRE) and the Java Development Kit (JDK).
The Java runtime environment (JRE) consists of the JVM and the Java class libraries
and contains the necessary functionality to start Java programs.
The JDK contains in addition the development tools necessary to create Java
programs. The JDK consists therefore of a Java compiler, the Java virtual machine,
and the Java class libraries.

9
CHAPTER 3
 INSTALLATION OF JAVA

3.1 Check Fig. java installing


installation:

Java might already be installed on your machine. You can test this by opening a
console (if you are using Windows. Win R, enter cmd and press Enter) and by typing
in the following command:

3.2 java -version

If Java is correctly installed, you should see some information about your Java
installation. If the command line returns the information that the program could not be
found, you have to install Java.

3.3 Installing the Java Development Kit:

Before installing the Java Development Kit (JDK), you should probably know what It
is distributed by Oracle. It contains the core libraries and compiler required to develop
Java. The JDK should not be confused with the JRE (Java Runtime Environment). The
RE is a JVM for running, as opposed to compiling. Java programs.

10
3.4 Downloading and Installing:

To download the JDK,08 http://www.oracle.com/technetwork/java/javase/downloads/index.html.


Click on "JDK with Net Beans Bundle". Follow the instructions for downloading the JDK
installation file.
Windows: If you are running Windows, simply run the executable file and follow the installation
instructions.
UNIX, Solaris, or Linux: For Linux and UNIX, download the "Jdk1 6,0" for Linux
systems. Save the downloaded file in any drive. Once you have saved the file, extract it to a place
that you can remember, by using Terminal or by double clicking on the file.

11
CHAPTER 4
 BASICS: CLASS AND OBJECT

Fig, BASICS: CLASS AND OBJECT

4.1 Class:
Def: Template that describes the data and behaviour associated with an instance of
that class. In Java source code a class is defined by the class keyword and must start
with a capital letter. The body of a class is surrounded by {}.

package test; class MyClass {

The data associated with a class is stored in variables; the behaviour associated to a
class or object is implemented with methods.

A class is contained in a Java source file with the same name as the class plus the java,
extension.

4.2 Object:
Def.: An object is an instance of a class.
The object is the real element which has data and can perform actions. Each object is
created based on the class definition.

4.3 Inheritance:
A class can be derived from another class. In this case this class is called a subclass.
Another common phrase is that a class extends another class.
The class from which the subclass is derived is called a superclass. Inheritance allows
a class to inherit the behaviour and data definitions of another class.
The following codes demonstrate how a class can extend another class. In Java a class
can extend a maximum of one class.

12
CHAPTER 5
 VARIABLES AND METHODS

5.1 Variable
Variables allow the Java program to store values during the runtime of the program.
A variable can either be a primitive variable or a reference variable. A primitive
variable contains value while the reference variable contains a reference (pointer) to
the object. Hence if you compare two reference variables, you compare if both point
to the same object. To compare objects use the objects. equals(object2) method call.

Fig Variables And Methods

5.1.1 Instance variable


Instance variable is associated with an instance of the class (also called object).
Access works over these objects. Instance variables can have any access control and
can be marked final or transient. Instance variables marked as final cannot be changed
after assigned to a value.
5.1.2 Local variable

Local (stack) variable declarations cannot have access modifiers. Final is the only modifier
available to local variables. This modifier defines that the variable cannot be changed after first
assignment. Local variables do not get default values, so they must be initialized before use.
5.1.3 Static Variables

When a variable is declared as static, then a single copy of the variable is created and shared
among all objects at a class level. Static variables are, essentially, global variables. All instances
of the class share the same static variable.
5.2 Methods
A method is a block of code with parameters and a return value. It can be called on the
object.
Import java.util.*;
Class MyClassMehod{
Public static void main(String [] args)
{
13
Void tester (String s) {
System.out.println(“Hello World!!”);
}
}
Method can be declared with var-args. In this case the method declares a parameter
which accepts from zero to many arguments (syntax: type.. name;) A method can only
have one var- args parameter and this must be the last parameter in the method.

Overwrite of a superclass method: A method must be of the exact same return


parameter and the same arguments. Also the return parameter must be the same.
Overload methods: An overloaded method is a method with the same name, but
different arguments. The return type can not be used to overload a method.

Main method

A public static method with the following signature can be used to start a Java
application. Such a method is typically called main method.

public static void main(String[] args){


}

5.3 Constructor
A class contains constructors that are invoked to create objects based on the class
definition. Constructor declarations look like method declarations except that they use
the name of the class and have no return type. A class can have several constructors
with different parameters. Each class must define at least one constructor.

5.4 Polymorphism
The word polymorphism means having many forms. In simple words, we can define
Java Polymorphism as the ability of a message to be displayed in more than one
form. In this article, we will learn what is polymorphism and it’s type.

Real-life Illustration of Polymorphism in Java: A person at the same time can have
different characteristics. Like a man at the same time is a father, a husband, and an
employee. So the same person possesses different behaviours in different situations.
This is called polymorphism.

14
CHAPTER 6

Types of Java Polymorphism


In Java Polymorphism is mainly divided into two types:

 Compile-time Polymorphism
 Runtime Polymorphism

Fig. Java Polymorphism

1) Compile-Time Polymorphism in Java

It is also known as static polymorphism. This type of polymorphism is achieved


by function overloading or operator overloading.
Note: But Java doesn’t support the Operator Overloading.

1.1) Method Overloading

When there are multiple functions with the same name but different parametersthen
these functions are said to be overloaded. Functions can be overloaded bychanges in the number
of arguments or/and a change in the type of arguments.

2) Runtime Polymorphism
In runtime polymorphism, the compiler resolves the object at run time and then it
decides which function call should be associated with that object. It is also known as dynamic or
late binding polymorphism. This type of polymorphism is executed through virtual functions and
function overriding

15
CHAPTER 7

 Java Arrays
Normally, an array is a collection of similar type of elements which has contiguous
memory location.

Java array is an object which contains elements of a similar data type. Additionally,
The elements of an array are stored in a contiguous memory location. It is a data
structure where we store similar elements. We can store only a fixed set of elements in
a Java array.

Array in Java is index-based, the first element of the array is stored at the 0th index,
2nd element is stored on 1st index and so on.

Fig. Java Arrays

16
CHAPTER 8

 TYPES OF OPERATORS IN JAVA

There are multiple types of operators in Java all are mentioned below:

1. Arithmetic Operators
They are used to perform simple arithmetic operations on primitive
data types.

Fig. Arithmetic Operators

2. Assignment Operator
‘=’ Assignment operator is used to assign a value to any variable. It has right-to-left
associativity, i.e. value given on the right-hand side of the operator is assigned to the
variable on the left, and therefore right-hand side value must be declared before
using it or should be a constant.
The general format of the assignment operator is:
variable = value;
 +=, for adding the left operand with the right operand and then assigning
it to the variable on the left.
 -=, for subtracting the right operand from the left operand and then
assigning it to the variable on the left.
 *=, for multiplying the left operand with the right operand and then
assigning it to the variable on the left.

Fig. Assignment Operator

17
3. Relational Operators

These operators are used to check for relations like equality, greater than, and less
than. They return Boolean results after the comparison and are extensively used in
looping statements as well as conditional if-else statements. The general format is,
variable relational operators value

Some of the relational operators are-


 ==, Equal to returns true if the left-hand side is equal to the right-hand
side.
 !=, Not Equal to returns true if the left-hand side is not equal to the right-
hand side.
 <, less than: returns true if the left-hand side is less than the right-hand
side.
 <=, less than or equal to returns true if the left-hand side is less than or
equal to the right-hand side.
 >, Greater than: returns true if the left-hand side is greater than theright-
hand side.
 >=, Greater than or equal to returns true if the left-hand side is greater
than or equal to the right-hand side.

4. Logical Operators
These operators are used to perform “logical AND” and “logical OR” operations, i.e.,
a function similar to AND gate and OR gate in digital electronics. One thing to keep
in mind is the second condition is not evaluated if the first one is false, i.e., it has a
short- circuiting effect. Used extensively to test for several conditions for making a
decision. Java also has “Logical NOT”, which returns true when the condition is false
and vice- versa
Conditional operators are:
 &&, Logical AND: returns true when both conditions are true.
 ||, Logical OR: returns true if at least one condition is true.
 !, Logical NOT: returns true when a condition is false and vice-versa

5. Bitwise Operators
These operators are used to perform the manipulation of individual bits of a number.
They can be used with any of the integer types. They are used when performing
update and query operations of the Binary indexed trees.
&, Bitwise AND operator: returns bit by bit AND of input value
|, Bitwise OR operator: returns bit by bit OR of input values.
^, Bitwise XOR operator: returns bit-by-bit XOR of input values

18
6. Shift Operators
These operators are used to shift the bits of a number left or right, thereby multiplying
or dividing the number by two, respectively. They can be used when we have to
multiply or divide a number by two. General format-
Number shift op number of places to shift;

 <<, Left shift operator: shifts the bits of the number to the left and fills
0 on voids left as a result. Similar effect as multiplying the number with
some power of two.
 >>, Signed Right shift operator: shifts the bits of the number to the right
and fills 0 on voids left as a result. The leftmost bit depends on the sign of
the initial number. Similar effect to dividing the number with some power
of two.
 >>>, Unsigned Right shift operator: shifts the bits of the number to the
right and fills 0 on voids left as a result. The leftmost bit is set to 0.

Fig. Shift Operators

1. Instance of operator

The instance of the operator is used for type checking. It can be used to test if an
object is an instance of a class, a subclass, or an interface. General format-
object instance of class/subclass/interface.

Fig. Instance of operator

19
CONCLUSION

My Java Developer Course provided a solid foundation for my career as a software


developer. It gave me the chance to apply theoretical knowledge to real-world
scenarios, collaborate with industry professionals, and learn essential skills like
effective communication, continuous learning, and debugging. Java is a high level,
robust, object- oriented and secure programming language. Java was developed by
Sun Microsystems (which is now the subsidiary of Oracle) in the year 1995. James
Goslingis known as the father of Java. Before Java, its name was Oak.

The work experiences I encountered during the course allowed me to develop


[specific skills]. I think I still require to work on my [mention other skills]. But, the
overall experience was positive, and everything I learned would be useful in my future
career in this field.

20

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy