Docsity

object oriented programming language java, Study notes of Javascript programming

Partial preview of the text

Download object oriented programming language java and more Study notes Javascript programming in PDF only on Docsity!

Object Oriented

Programming

using Java

Unit – 1

Object Oriented Programming using Java

Semester – II

Prof. Vaishnavi .J. Patil

Syllabus Structure Object Oriented Programming using Java (DJS23FCES201 ) Teaching Scheme Semester End Assessment (B) : 60 Marks Theory : 2 Hrs. / week Credits : 2 Continuous Assessment (Th) (A) : 40 Marks A + B = 40 + 60 = 100 Marks. Object Oriented Programming using Java Laboratory (DJS23FCES201) Teaching Scheme Practical : 2 Hrs. / week Credits : 1 Continuous Assessment (T/W) : 25 Marks

Course Outcomes: On completion of the course, the learner will be able to:

  1. Develop programs by applying Object-Oriented concepts of JAVA to solve real- world problems.
  2. Achieve Robustness and Concurrency while developing programs
  3. Design Graphical User Interface using swing.

Content  (^) Fundamentals of JAVA programming: Overview of Procedure and object oriented programming.  (^) Features of JAVA  (^) Java Virtual Machine  (^) Principles of OOP : Object Class Encapsulation Abstraction Inheritance Polymorphism  (^) Basic Constructs  (^) Operator and Expression  (^) Input & Output in JAVA Command Line Argument BufferedReader class Scanner class

Fundamentals of Java Programming: Java is a very popular high level programming language and has been used widely to create various types of computer applications such as

  • (^) Database applications
  • (^) Desktop applications
  • (^) Web based applications
  • (^) Mobile applications and
  • (^) Games among others.

Procedural Programming : It is a programming model which is derived from structured programming, based upon the concept of calling procedure. Procedures, also known as routines, subroutines or functions, simply consist of a series of computational steps to be carried out. During a program’s execution, any given procedure might be called at any point, including by other procedures or itself. Example : C language, Fortran, Algol, Cobol, Basic, Pascal etc.

Object-Oriented Programming : Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects that contain data (fields) and behavior (methods). It focuses on designing software that closely represents real- world entities. It is used to:  (^) Improves code reusability  (^) Enhances maintainability and scalability  (^) Makes programs easier to understand and manage  (^) Closely models real-world entities

Procedural Oriented Programming Vs. Object-Oriented Programming :

Procedural Oriented Programming Vs. Object-Oriented Programming :

Features of Java Object-Oriented

  • (^) Java is an object-oriented language.
  • (^) It uses objects and classes, which makes programs easy to design and expand. Platform Independent
  • (^) Java programs can run on any operating system.
  • (^) A program written once can be used everywhere. Simple
  • (^) Java is easy to learn and understand.
  • (^) Its syntax is similar to C and C++, but it removes complex features. Secure
  • (^) Java is a secure programming language.
  • (^) It protects programs from viruses and harmful code.

Garbage Collection Java uses a Garbage Collector which runs automatically by the JVM. It removes objects that are no longer used in the program. This helps to free memory and improves program performance Distributed Java supports distributed applications. In a distributed system, many computers are connected and can share data and information. Java can be used to create such network-based applications.

Multithreading

  • (^) Multithreading means doing multiple tasks at the same time.
  • (^) Java supports multithreaded programs.
  • (^) It allows one program to perform many tasks without waiting.
  • (^) Example: playing a movie, using Paint, and scanning the PC at the same time. High Performance
  • Java is a fast programming language.
  • (^) It uses Just-In-Time (JIT) compiler , which improves execution speed.
  • (^) This makes Java programs run efficiently.

Java Virtual Machine :

  • (^) A Java compiler instead of translating Java code to machine language code, translates it into Java Bytecode (a highly optimized set of instructions).
  • (^) When the bytecode (also called a Java class file) is to be run on a computer, a Java interpreter, called the Java Virtual Machine (JVM), translates the bytecode into machine code and then executes it.
  • (^) The advantage of JVM makes Java programs platform independent and highly portable.

Java Virtual Machine