SlideShare a Scribd company logo
OBJECT
ORIENTED
PROGRAMMING
USING JAVA
V SEMESTER – BSC(PMCS)
DEPARTMENT OF COMPUTER SCIENCE
GOVERNMENT FIRST GRADE COLLEGE, MALUR
Dr. HAMELA K
SYLLABUS
Unit - I
Introduction to JAVA: JAVA Evolution: Java History, Java Features, How Java Differs from C and C++, Java
and Internet, Java and World Wide Web, Web Browsers, Hardware and Software Requirements, Java
Support Systems, Java Environment. Overview of JAVA Language: Introduction, Simple Java program,
More of Java Statements, Implementing a Java Program, Java Virtual Machine, Command Line
Arguments, Programming Style. Constants, Variables, and Data Types: Introduction, Constants, Variables,
Data Types, Declaration of Variables, Giving Values to Variables, Scope of Variables, Symbolic Constants,
Type Casting, Getting Values of Variables, Standard Default Values, Operators and Expressions:
Introduction, Arithmetic Operators, Relational Operators Logical Operators, Assignment Operators,
Increment and Decrement Operators, Conditional Operators, Bitwise Operators, Special Operators,
Arithmetic Expressions, Evaluation of Expressions, Procedence of Arithmetic Operators, Type Conversion
and Associativity, Mathematical Functions. Decision Making and Branching: Introduction, Decision
Making with if Statement, Simple if Statement, The if…..else Statement, Nesting of if..else Statements,
The else if Ladder, The Switch Statement, The ? : Operator. Decision Making and Looping: Introduction.
The while Statement, The do Statement, The for Statement, Jumps in Loops Labeled Loops
Object Oriented Programming using Java..
Object Oriented Programming using Java..
Object Oriented Programming using Java..
HISTORY OF JAVA
Key Features of Java
Platform independent
Object-orientated programming language
Strongly-typed programming language
Interpreted and compiled language
Automatic memory management
Difference between c and Java
⚫ 1. JAVA is Object-Oriented while C is procedural. Different Paradigms, that is.
⚫ C is more procedure-oriented while JAVA is data-oriented.
⚫ 2. Java is an Interpreted language while C is a compiled language.
⚫ We all know what a compiler does. It takes your code & translates it into something the
machine can understand-that is to say-0’s & 1’s-the machine-level code. That’s exactly what
happens with our C code-it gets ‘compiled’. While with JAVA, the code is first transformed to
what is called the bytecode. This bytecode is then executed by the JVM(Java Virtual Machine).
For the same reason, JAVA code is more portable.
⚫ 3. C is a low-level language while JAVA is a high-level language.
⚫ C is a low-level language(difficult interpretation for the user, closer significance to the machine-
level code) while JAVA is a high-level lagunage(abstracted from the machine-level details, closer
significance to the program itself).
⚫ 4. C uses the top-down {sharp & smooth} approach while JAVA uses the bottom-up {on the
rocks} approach.
⚫ In C, formulating the program begins by defining the whole and then splitting them into smaller
elements. JAVA(and C++ and other OOP languages) follows the bottom-up approach where the
smaller elements combine together to form the whole.
⚫ 5. Pointer go backstage in JAVA while C requires explicit handling of pointers.
⚫ When it comes to JAVA, we don’t need the *’s & &’s to deal with pointers & their addressing.
More formally, there is no pointer syntax required in JAVA. It does what it needs to do. While in
JAVA, we do create references for objects.
C++ and JAVA
C++ JAVA
C++ supports pointers Java does not pointers
C++ run and compile using compiler which
converts source code into machine level
languages so c++ is plate from dependents
At compilation time Java Source code converts
into byte code .The interpreter execute this
byte code at run time and gives output .Java is
interpreted for the most part and hence
platform independent
c++ is depends upon operating system machine
etc
Java is platform independent language
c++ their is only compiler Java uses compiler and interpreter both
C++ supports operator overloading java does not.
Thread support is not available in Java Thread support is built-in Java
Internet support does not exist Internet support is built-in Java but not in C++.
Java does not support header file, include library
files just like C++ .
Java use import to include different Classes and
methods.
Goto statement exist in C++ There is no goto statement in Java.
operator overloading exist in c++. Java has method overloading, but no operator
overloading just like c++.
C++ support unsigned integer. Java does not support unsigned integer.
Java and Internet:
⚫ Java is strongly associated with the Internet. Internet users can use
Java to create applet programs and run them locally using a "Java-
enabled browser" such as HotJava.
⚫ They can also use a Java-enabled browser to download an applet
located on a computer anywhere in the Internet and run it on his
local computer.
⚫ In fact, Java applets have made the Internet a true extension of the
storage system of the local computer.
⚫ Internet users can also setup their websites containing java applets
that could be used by other remote users of Internet. This feature
made Java most popular programming language for Internet.
Java and WWW
• Java’s Contribution to the Internet (World Wide Web):
⚫ Great feature of the java is that java is platform independent.
⚫ It can word on any network,any operating system thus making
programs more flexible.
⚫ In addition to simplifying web programming in general, Java
innovated a new type of networked program called the applet that
changed the way the online world thought about content.
⚫ Portability and Security of java makes World wide web to spread
across globe.
www
⚫ World Wide Web (WWW) is an open-ended information
retrieval system designed to be used in the Internet's
distributed environment. This system contains Web pages
that provide both information and controls. Web system is
open-ended and we can navigate to a new document in any
direction. This is made possible with the help of a language
called Hypertext Markup Language (HTML). Web pages
contain HTML tags that enable us to find, retrieve,
manipulate and display documents worldwide.
Java
⚫ Java was meant to be used in distributed environments such as Internet.
Since, both the Web and Java share the same philosophy, Java could be
easily incorporated into the Web system. Before Java, the World Wide
Web was limited to the display of still images and texts. However, the
incorporation of Java into Web pages has made it capable of supporting
animation, graphics, games, and a wide range of special effects.
• A. Java Applets :
⚫ An applet is a special kind of Java program that is designed to be
transmitted over the Internet and automatically executed by a Java-
compatible web browser.
⚫ Applet can be downloaded on demand.
⚫ Applet programs can be run on ant java compatible browser.
⚫ Applets are intended to be small programs.
⚫ They are typically used to display data provided by the server, handle
user input, or provide simple functions, such as a loan calculator, that
execute locally, rather than on the server.
⚫ In essence, the applet allows some functionality to be moved from the
server to the client.
• B. Security :
⚫ Applets can be downloaded to user PC .
⚫ They are executed independently without accessing other parts of
user’s PC.
⚫ The ability of Java provides security and thus Java prove itself more
secure.
• C. Portability :
⚫ Java Programming is Portable.
⚫ Java Program is Operating System Independent.
⚫ Java Program is converted into byte code and byte code is executed by
JVM.
⚫ Java Applets are thus portable and can be downloaded from any place
in globe and can be executed on java compatible browser thus making
java programs portable.
• Five primary goals in the creation of the Java language :
⚫ It should be “simple, object-oriented and familiar”.
⚫ It should be “robust and secure”.
⚫ It should be “architecture-neutral and portable”.
⚫ It should execute with “high performance”.
⚫ It should be “interpreted, threaded, and dynamic”.

More Related Content

PPTX
Introduction to java
PPTX
Java. converted (2)
PPT
Java ppt-class_basic data types methods definitions
PPTX
Introduction to java
PPTX
Introduction to java
PPTX
java slides
PPT
Java ppt-class_Introduction_class_Objects.ppt
PPTX
UNIT 1 Programming in java Bsc program.pptx
Introduction to java
Java. converted (2)
Java ppt-class_basic data types methods definitions
Introduction to java
Introduction to java
java slides
Java ppt-class_Introduction_class_Objects.ppt
UNIT 1 Programming in java Bsc program.pptx

Similar to Object Oriented Programming using Java.. (20)

PPTX
Java Introduction
PPTX
Java Programming
PPT
00 intro to java
PPTX
Java Basics
PPTX
Java in Mule
PPTX
Java Basics in Mule
PPTX
JAVA ALL 5 MODULE NOTES.pptx
PDF
0f0cef_1dac552af56c4338ab0672859199e693.pdf
PPTX
Introduction to java
PDF
Java Evolution-2.pdf
PPTX
java tutorial for beginner - Free Download
DOCX
java introduction.docx
DOCX
Srgoc java
PPTX
Unit1 introduction to Java
PPTX
Introduction to java
PPTX
Introduction to java
PPT
Java for C++ programers
PPTX
Unit1- OOPJ Chapter-1 Object Oriented Programming JAVA.pptx
Java Introduction
Java Programming
00 intro to java
Java Basics
Java in Mule
Java Basics in Mule
JAVA ALL 5 MODULE NOTES.pptx
0f0cef_1dac552af56c4338ab0672859199e693.pdf
Introduction to java
Java Evolution-2.pdf
java tutorial for beginner - Free Download
java introduction.docx
Srgoc java
Unit1 introduction to Java
Introduction to java
Introduction to java
Java for C++ programers
Unit1- OOPJ Chapter-1 Object Oriented Programming JAVA.pptx
Ad

Recently uploaded (20)

PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
PPTX
Glazing at Facade, functions, types of glazing
PPTX
anatomy of limbus and anterior chamber .pptx
PPT
High Data Link Control Protocol in Data Link Layer
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
PPTX
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
PPTX
meets orient on the new industry intereacting skills .pptx
PPT
Ppt for engineering students application on field effect
PPT
Chapter 6 Design in software Engineeing.ppt
PDF
Geotechnical Engineering, Soil mechanics- Soil Testing.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
AgentX UiPath Community Webinar series - Delhi
PDF
Top 10 read articles In Managing Information Technology.pdf
PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PDF
6th International Conference on Artificial Intelligence and Machine Learning ...
PDF
flutter Launcher Icons, Splash Screens & Fonts
PDF
Chad Ayach - A Versatile Aerospace Professional
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
Glazing at Facade, functions, types of glazing
anatomy of limbus and anterior chamber .pptx
High Data Link Control Protocol in Data Link Layer
Structs to JSON How Go Powers REST APIs.pdf
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
meets orient on the new industry intereacting skills .pptx
Ppt for engineering students application on field effect
Chapter 6 Design in software Engineeing.ppt
Geotechnical Engineering, Soil mechanics- Soil Testing.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
AgentX UiPath Community Webinar series - Delhi
Top 10 read articles In Managing Information Technology.pdf
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
6th International Conference on Artificial Intelligence and Machine Learning ...
flutter Launcher Icons, Splash Screens & Fonts
Chad Ayach - A Versatile Aerospace Professional
Ad

Object Oriented Programming using Java..

  • 1. OBJECT ORIENTED PROGRAMMING USING JAVA V SEMESTER – BSC(PMCS) DEPARTMENT OF COMPUTER SCIENCE GOVERNMENT FIRST GRADE COLLEGE, MALUR Dr. HAMELA K
  • 2. SYLLABUS Unit - I Introduction to JAVA: JAVA Evolution: Java History, Java Features, How Java Differs from C and C++, Java and Internet, Java and World Wide Web, Web Browsers, Hardware and Software Requirements, Java Support Systems, Java Environment. Overview of JAVA Language: Introduction, Simple Java program, More of Java Statements, Implementing a Java Program, Java Virtual Machine, Command Line Arguments, Programming Style. Constants, Variables, and Data Types: Introduction, Constants, Variables, Data Types, Declaration of Variables, Giving Values to Variables, Scope of Variables, Symbolic Constants, Type Casting, Getting Values of Variables, Standard Default Values, Operators and Expressions: Introduction, Arithmetic Operators, Relational Operators Logical Operators, Assignment Operators, Increment and Decrement Operators, Conditional Operators, Bitwise Operators, Special Operators, Arithmetic Expressions, Evaluation of Expressions, Procedence of Arithmetic Operators, Type Conversion and Associativity, Mathematical Functions. Decision Making and Branching: Introduction, Decision Making with if Statement, Simple if Statement, The if…..else Statement, Nesting of if..else Statements, The else if Ladder, The Switch Statement, The ? : Operator. Decision Making and Looping: Introduction. The while Statement, The do Statement, The for Statement, Jumps in Loops Labeled Loops
  • 7. Key Features of Java Platform independent Object-orientated programming language Strongly-typed programming language Interpreted and compiled language Automatic memory management
  • 8. Difference between c and Java ⚫ 1. JAVA is Object-Oriented while C is procedural. Different Paradigms, that is. ⚫ C is more procedure-oriented while JAVA is data-oriented. ⚫ 2. Java is an Interpreted language while C is a compiled language. ⚫ We all know what a compiler does. It takes your code & translates it into something the machine can understand-that is to say-0’s & 1’s-the machine-level code. That’s exactly what happens with our C code-it gets ‘compiled’. While with JAVA, the code is first transformed to what is called the bytecode. This bytecode is then executed by the JVM(Java Virtual Machine). For the same reason, JAVA code is more portable. ⚫ 3. C is a low-level language while JAVA is a high-level language. ⚫ C is a low-level language(difficult interpretation for the user, closer significance to the machine- level code) while JAVA is a high-level lagunage(abstracted from the machine-level details, closer significance to the program itself). ⚫ 4. C uses the top-down {sharp & smooth} approach while JAVA uses the bottom-up {on the rocks} approach. ⚫ In C, formulating the program begins by defining the whole and then splitting them into smaller elements. JAVA(and C++ and other OOP languages) follows the bottom-up approach where the smaller elements combine together to form the whole. ⚫ 5. Pointer go backstage in JAVA while C requires explicit handling of pointers. ⚫ When it comes to JAVA, we don’t need the *’s & &’s to deal with pointers & their addressing. More formally, there is no pointer syntax required in JAVA. It does what it needs to do. While in JAVA, we do create references for objects.
  • 9. C++ and JAVA C++ JAVA C++ supports pointers Java does not pointers C++ run and compile using compiler which converts source code into machine level languages so c++ is plate from dependents At compilation time Java Source code converts into byte code .The interpreter execute this byte code at run time and gives output .Java is interpreted for the most part and hence platform independent c++ is depends upon operating system machine etc Java is platform independent language c++ their is only compiler Java uses compiler and interpreter both C++ supports operator overloading java does not. Thread support is not available in Java Thread support is built-in Java Internet support does not exist Internet support is built-in Java but not in C++. Java does not support header file, include library files just like C++ . Java use import to include different Classes and methods. Goto statement exist in C++ There is no goto statement in Java. operator overloading exist in c++. Java has method overloading, but no operator overloading just like c++. C++ support unsigned integer. Java does not support unsigned integer.
  • 10. Java and Internet: ⚫ Java is strongly associated with the Internet. Internet users can use Java to create applet programs and run them locally using a "Java- enabled browser" such as HotJava. ⚫ They can also use a Java-enabled browser to download an applet located on a computer anywhere in the Internet and run it on his local computer. ⚫ In fact, Java applets have made the Internet a true extension of the storage system of the local computer. ⚫ Internet users can also setup their websites containing java applets that could be used by other remote users of Internet. This feature made Java most popular programming language for Internet.
  • 11. Java and WWW • Java’s Contribution to the Internet (World Wide Web): ⚫ Great feature of the java is that java is platform independent. ⚫ It can word on any network,any operating system thus making programs more flexible. ⚫ In addition to simplifying web programming in general, Java innovated a new type of networked program called the applet that changed the way the online world thought about content. ⚫ Portability and Security of java makes World wide web to spread across globe.
  • 12. www ⚫ World Wide Web (WWW) is an open-ended information retrieval system designed to be used in the Internet's distributed environment. This system contains Web pages that provide both information and controls. Web system is open-ended and we can navigate to a new document in any direction. This is made possible with the help of a language called Hypertext Markup Language (HTML). Web pages contain HTML tags that enable us to find, retrieve, manipulate and display documents worldwide.
  • 13. Java ⚫ Java was meant to be used in distributed environments such as Internet. Since, both the Web and Java share the same philosophy, Java could be easily incorporated into the Web system. Before Java, the World Wide Web was limited to the display of still images and texts. However, the incorporation of Java into Web pages has made it capable of supporting animation, graphics, games, and a wide range of special effects.
  • 14. • A. Java Applets : ⚫ An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java- compatible web browser. ⚫ Applet can be downloaded on demand. ⚫ Applet programs can be run on ant java compatible browser. ⚫ Applets are intended to be small programs. ⚫ They are typically used to display data provided by the server, handle user input, or provide simple functions, such as a loan calculator, that execute locally, rather than on the server. ⚫ In essence, the applet allows some functionality to be moved from the server to the client.
  • 15. • B. Security : ⚫ Applets can be downloaded to user PC . ⚫ They are executed independently without accessing other parts of user’s PC. ⚫ The ability of Java provides security and thus Java prove itself more secure. • C. Portability : ⚫ Java Programming is Portable. ⚫ Java Program is Operating System Independent. ⚫ Java Program is converted into byte code and byte code is executed by JVM. ⚫ Java Applets are thus portable and can be downloaded from any place in globe and can be executed on java compatible browser thus making java programs portable.
  • 16. • Five primary goals in the creation of the Java language : ⚫ It should be “simple, object-oriented and familiar”. ⚫ It should be “robust and secure”. ⚫ It should be “architecture-neutral and portable”. ⚫ It should execute with “high performance”. ⚫ It should be “interpreted, threaded, and dynamic”.