fundamentals of java

15
www.company.com VSQUARE SYSTEMS PVT LTD. FUNDAMENTALS OF JAVA PRESENTED BY KUNAL V.GADHIA

Upload: kunal-gadhia

Post on 15-Jul-2015

146 views

Category:

Education


1 download

TRANSCRIPT

www.company.com

VSQUARE SYSTEMS PVT LTD.

FUNDAMENTALS OF JAVA

PRESENTED BY

KUNAL V.GADHIA

www.company.com

INDEX:

1. About JAVA.

2. Fundamentals of OOP’s.

3. JAVA Application & Applets.

4. Multithreading.

5. Network(IO).

6. My SQL.

7. JDBC.

www.company.com

ABOUT JAVA

1. JAVA was designed by Mr.James Goslings and SUN Microsystems in 1995 and was developed by ORACLE Corp.

2. JAVA is a general-purpose computer programming language that is concurrent, class-based, object oriented.

3. JAVA Applications are typically compiled to bytecode that can run on any JVM regardless of computer architecture.

4. The language was initially called Oak after an oak tree that stood outside Gosling’s office, later renamed as JAVA.

www.company.com

Fundamentals of OOP’s

www.company.com

• Abstraction:

Abstraction is used to manage complexity.Software developers use use abstraction to decompose complex systems into smaller components.as development progresses,programmers know the functionality they can expect from as yet undeveloped subsystems.

• Encapsulation: Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, It cannot be accessed by anyone outside the class, thereby hiding the fields within the class .For this reason, encapsulation is also referred to as data hiding.

www.company.com

• Inheritance:

Inheritance in JAVA is a mechanism in which one object acquires all the properties and behaviors of parent object.

The idea behind inheritance in JAVA is that you can create new classes upon existing class, you can reuse methods of fields of parent class, and you can add new methods and fields also.

• Polymorphism:Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in oop occurs when a parent class reference is used to refer to a child class object.Any JAVA object that can pass more than one IS-A test is considered to be polymorphic.

www.company.com

JAVA Application & Applets:

• There are two types of programs that can be built in Java Applications and applets.

• Applications can be directly executed by a JVM. In fact, Java can be used to develop programs for all kinds of applications.

• “An Applet is a special kind of program that is primarily used in internet computing.”

• Some restrictions related to applet programming:1. Applets cannot read or write to the file systems.2. Applet cannot communicate with any other server than

the one in which they are stored originally.3. Applet cannot run any program on the system.

www.company.com

Steps to develop & test Applet

Build an Applet code(.java file). Compile the Applet(.class file). Design a web page using HTML tag(HTML file). Preparing an <APPLET> tag. Host an <APPLET> tag into the web page.

www.company.com

Multithreading

• Java is a multithreaded programming language which means we can develop multithreaded program using Java.

• A multithreaded program contains two or more parts that can run concurrently and each part can handle different task at the same time making optimal use of the available resources specially when your computer has multiple CPUs.

• By definition multitasking is when multiple processes share common processing resources such as a CPU. Multithreading extends the idea of multitasking into applications where you can subdivide specific operations within a single application into individual threads.

www.company.com

Life cycle of a Thread:

www.company.com

Network(IO):

• The java.io package contains nearly every class you might ever need to perform input and output (I/O) in Java. All these streams represent an input source and an output destination. The stream in the java.io package supports many data such as primitives, Object, localized characters, etc.

• A stream can be defined as a sequence of data. The Input Stream is used to read data from a source and the Output Stream is used for writing data to a destination.

• Java provides strong but flexible support for I/O related to Files and networks but this tutorial covers very basic functionality related to streams and I/O. We would see most commonly used example one by one

www.company.com

Hierarchy of classes to deal with IO:

www.company.com

My SQL:

• MySQLis (as of March 2014) the world's second most

widely used open-source relational database management systems (RDBMS).It is named after co-founder Michael Widenius’s daughter, My The SQL phrase stands for Structured Query Language.

• The basic fundamentals of database are:

1. Insert.

2. Update.

3. Delete.

www.company.com

JDBC:

• JDBC is a Java database connectivity technology (Java Standard Edition platform) from Oracle Corp. This technology is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC I

• JDBC connections support creating and executing statements. These may be update statements such as SQL's create, insert, update and delete, or they may be query statements such as select. Additionally, stored procedures may be invoked through a JDBC connection s oriented towards relational databases.

www.company.com

Thank you!!!