Introduction to Java Programming PDF
Document Details
![RightJadeite3956](https://quizgecko.com/images/avatars/avatar-5.webp)
Uploaded by RightJadeite3956
Tags
Related
- CS0070 Object-Oriented Programming Module 1 PDF
- Object Oriented Programming (2nd Year 1st Sem) PDF
- VILLASAN Object-Oriented Programming PDF
- Introduction To Object Oriented Programming PDF
- Object-Oriented Programming Prelim Workbook PDF (2025)
- Unit-1 Introduction to Object Oriented Programming and Basic Concepts PDF
Summary
This document provides an introduction to Java programming, focusing on object-oriented programming concepts. It covers basic Java concepts, object-oriented programming, and constructors. The document also includes examples of Java code and explanations.
Full Transcript
{ Introduction to Java Programming PROG3: OBJECT-ORIENTED PROGRAMMING... } Table of contents 01 Java Programming Review of the Basic Java Concepts 02 Object-Oriented Programming Attributes and Classes 03 C...
{ Introduction to Java Programming PROG3: OBJECT-ORIENTED PROGRAMMING... } Table of contents 01 Java Programming Review of the Basic Java Concepts 02 Object-Oriented Programming Attributes and Classes 03 CONSTRUCTORS Definition and Uses JAVA PROGRAMMING } A JAVA Programming language for entry-level programmers that can help your way up to becoming a successful developer. 01 {.. Review basic Java Concepts }.. { Java Programming Welcome to the world of Java The principles for creating Java programming! programming were "Simple, Robust, Portable, Platform- Programming languages enable independent, Secured, High humans to write instructions Performance, Multithreaded, that a computer can perform. Architecture Neutral, Object- With precise instructions, Oriented, Interpreted, and computers coordinate Dynamic". applications and systems that run the modern world. }.. { Java Programming Java is a popular programming Desktop applications language, created in 1995. Web applications Web servers and application It is owned by Oracle, and more servers than 3 billion devices run Java. Games Database connection It is used for: And much, much more! Mobile applications (specially Android apps) }.. Review of Basic Java Concepts Write a Java program to print 'Hello' on screen and then print your name on a separate line. Expected Output : Hello Ryan Christian { Review of Basic Java Concepts Package is like a folder in a directory where we can throw all our related codes in the same directory.... } { Review of Basic Java Concepts Every line of code that runs in Java MUST be inside a class and the class name should ALWAYS start with an uppercase first letter. In our example, we named the class Main.... } { Review of Basic Java Concepts The main() method is required and you will see it in every Java program.... } { Review of Basic Java Concepts Inside the main() method, we can use the println() method to print a line of text to the screen.... } Review of Basic Java Concepts In reviewing the basics of Java Concepts, we need to remember the following: Variables and Data Types Arrays and Math Class * Control Flow Structures and the most important thing: the way of analyzing and understanding every problem to create programs. Variables and Data Types {.. char byte/short/ int/long character data Primitive integer data types types Data Types float / double boolean floating point data boolean values true types or false }.. Variables and Data Types {.. string arrays A string of characters Reference A collection of data data types types Data Types classes interfaces Class can be a A full abstract class reference too that is implemented in other classes }.. { OBJECT-ORIENTED PROGRAMMING It focuses on implementing real- It is created by the programmer. world objects using Classes to It will act as a blueprint of an create variations of Objects, object that you want to that have attributes and implement in your program. purpose. They contain all the attributes It helps us create much flexible and methods that your desired and efficient code than object should have. procedural programming. }.. OBJECT-ORIENTED PROGRAMMING { Objects Attributes It is created by These are the global instantiating a Class. variables declared It is anything that has inside the class of our an attribute and a object. purpose. It is used to create Example: Person, variables of an object Furniture and Food using only one class. } { CLASS Creation modifiers class ClassName{ //Attributes //Methods or Purpose } } { CLASS Instantiation ClassName identifier = new ClassName(); Person p = new Person(); } ACCESSING Attributes ClassName identifier = new ClassName(); WRITING Attributes Identifier.attribute = value; READING Attributes System.out.println(identifier.attribute); ACCESSING Attributes { ACCESSING Attributes Inside the main() method, we can use the println() method to print a line of text to the screen.... } CONSTRUCTORS Is the method called when you instantiate a class / create an object. It is used to initialize the attributes of an object or run a block of code when an object is created. { CREATING Constructors modifier class ClassName{ className(){ //Constructor } } } CREATING Constructors USING CONSTRUCTORS Constructors are used to initialize attributes. public class Product{ String name; float price; Product(String name, float price){ this.name = name; this.price = price; } } THIS Keyword The this keyword refers to the class itself. The this keyword will enable you to access global variables inside the class if you have the same variable names in a parameter. USING CONSTRUCTORS ClassName identifier = new ClassName(parameters); Product p1 = new Product(“Milk”, 150.0f); Product p2 = new Product(“Milk”, 150.0f); Product p3 = new Product(“Softdrinks”, 150.0f); USING CONSTRUCTORS Write a constructor that will create a person with the following data. FirstName, LastName, Age, Sex Expected Output : RC Nono M 18 End of Module 1 Thank you for listening attentively. You can now download this module on google classroom. Thanks! < Do you have any questions? > [email protected] +34 654 321 432 yourwebsite.com CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and Slidesgo Flaticon infographics & images by Freepik Freepik Please keep this slide for attribution Alternative resources Here’s an assortment of alternative resources whose style fits the one of this template: Programmers concept with flat design Resources Did you like the resources on this template? Get them for free at our other websites: Photos Html and css collage concept with person I Html and css collage concept with person II Html and css collage concept with person III Html and css collage concept with person IV Medium shot smiley woman at library Medium shot man holding notebook