The document discusses object-oriented programming concepts related to inheritance in Java, including:
- Inheritance allows a subclass to inherit attributes and behaviors from its superclass. Subclasses can add, use, or override inherited functionality.
- Abstract classes can contain abstract methods that are declared but not defined. Subclasses must define all abstract methods to be instantiated. Abstract classes prevent direct instantiation.
- Polymorphism allows calling the same method on different object types, with the actual implementation determined at runtime based on the object's type. Method overriding in subclasses enables polymorphism.
- Final methods and classes prevent overriding and extension, respectively. This can improve security or performance. All non-static methods are virtual by default
The origin: Init (presentation version)Tzung-Bi Shih
This document discusses COSCUP 2016 and provides information on several topics related to Linux systems initialization including init systems like sysvinit, upstart, and systemd. It compares features of different init systems and how they handle processes and services. The document also covers low-level boot concepts like the BIOS, grub, and the /etc/rc directory structure in Linux systems initialization.
The document discusses different methods for managing services and daemons at system startup. It begins by explaining that traditional init systems launched processes in a specific order, but that event-driven systems are now more common. It then provides examples of init systems including launchd, upstart, and systemd. Launchd configurations in macOS are defined through XML property list files that can start daemons, sockets, periodic jobs, and monitor directories for changes.
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
We asked LinkedIn members worldwide about their levels of interest in the latest wave of technology: whether they’re using wearables, and whether they intend to buy self-driving cars and VR headsets as they become available. We asked them too about their attitudes to technology and to the growing role of Artificial Intelligence (AI) in the devices that they use. The answers were fascinating – and in many cases, surprising.
This SlideShare explores the full results of this study, including detailed market-by-market breakdowns of intention levels for each technology – and how attitudes change with age, location and seniority level. If you’re marketing a tech brand – or planning to use VR and wearables to reach a professional audience – then these are insights you won’t want to miss.
Inheritance allows classes to establish a hierarchical "is-a" relationship where subclasses inherit and extend the functionality of superclasses. A subclass inherits all fields and methods from its direct superclass and inherits from all superclasses up the class hierarchy with Object at the top. Constructors must call superclass constructors to initialize inherited fields properly. Subclasses can override methods of superclasses to provide specialized implementations while preserving the original signature. Polymorphism occurs when subclass objects are referenced by superclass references and the method invoked is based on the object's actual type. Final methods and classes prevent overriding and extension respectively.
The document provides an overview of iOS application development using Objective-C. It discusses that Objective-C adds object-oriented programming to C by incorporating Smalltalk-style messaging. It also notes that Objective-C is the main programming language used by Apple for iOS and OS X operating systems. The document then covers Objective-C syntax, classes, memory management using reference counting, protocols, blocks, and exception handling.
The document discusses key concepts in Object Oriented Programming (OOP) in Java including classes, objects, references, constructors, inheritance, abstraction, polymorphism, and generics. It defines classes as blueprints for objects, and objects as instances of classes that have state and behavior. Constructors are used to initialize new objects. Inheritance and abstraction allow classes to extend and implement other classes and interfaces. Polymorphism enables different classes to implement the same methods in different ways. Generics provide type safety for collections of objects.
The document discusses inheriting a Bank Account class as Saving and Current account classes. It covers key concepts of inheritance like subclasses inheriting properties and behaviors of the parent class. It also discusses overriding methods, using the super keyword to call parent constructors, and differences between overriding vs overloading methods.
The origin: Init (presentation version)Tzung-Bi Shih
This document discusses COSCUP 2016 and provides information on several topics related to Linux systems initialization including init systems like sysvinit, upstart, and systemd. It compares features of different init systems and how they handle processes and services. The document also covers low-level boot concepts like the BIOS, grub, and the /etc/rc directory structure in Linux systems initialization.
The document discusses different methods for managing services and daemons at system startup. It begins by explaining that traditional init systems launched processes in a specific order, but that event-driven systems are now more common. It then provides examples of init systems including launchd, upstart, and systemd. Launchd configurations in macOS are defined through XML property list files that can start daemons, sockets, periodic jobs, and monitor directories for changes.
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
We asked LinkedIn members worldwide about their levels of interest in the latest wave of technology: whether they’re using wearables, and whether they intend to buy self-driving cars and VR headsets as they become available. We asked them too about their attitudes to technology and to the growing role of Artificial Intelligence (AI) in the devices that they use. The answers were fascinating – and in many cases, surprising.
This SlideShare explores the full results of this study, including detailed market-by-market breakdowns of intention levels for each technology – and how attitudes change with age, location and seniority level. If you’re marketing a tech brand – or planning to use VR and wearables to reach a professional audience – then these are insights you won’t want to miss.
Inheritance allows classes to establish a hierarchical "is-a" relationship where subclasses inherit and extend the functionality of superclasses. A subclass inherits all fields and methods from its direct superclass and inherits from all superclasses up the class hierarchy with Object at the top. Constructors must call superclass constructors to initialize inherited fields properly. Subclasses can override methods of superclasses to provide specialized implementations while preserving the original signature. Polymorphism occurs when subclass objects are referenced by superclass references and the method invoked is based on the object's actual type. Final methods and classes prevent overriding and extension respectively.
The document provides an overview of iOS application development using Objective-C. It discusses that Objective-C adds object-oriented programming to C by incorporating Smalltalk-style messaging. It also notes that Objective-C is the main programming language used by Apple for iOS and OS X operating systems. The document then covers Objective-C syntax, classes, memory management using reference counting, protocols, blocks, and exception handling.
The document discusses key concepts in Object Oriented Programming (OOP) in Java including classes, objects, references, constructors, inheritance, abstraction, polymorphism, and generics. It defines classes as blueprints for objects, and objects as instances of classes that have state and behavior. Constructors are used to initialize new objects. Inheritance and abstraction allow classes to extend and implement other classes and interfaces. Polymorphism enables different classes to implement the same methods in different ways. Generics provide type safety for collections of objects.
The document discusses inheriting a Bank Account class as Saving and Current account classes. It covers key concepts of inheritance like subclasses inheriting properties and behaviors of the parent class. It also discusses overriding methods, using the super keyword to call parent constructors, and differences between overriding vs overloading methods.
The document discusses a workshop on object-oriented programming. It begins with introducing the speaker and providing his credentials and contact information. It then covers key topics in object-oriented programming including classes, objects, namespaces, functions, methods, constructors, destructors, and the four pillars of OOP - encapsulation, inheritance, polymorphism, and abstraction. For each topic, it provides definitions and examples to explain the concepts. It emphasizes that OOP is a programming paradigm based on objects that can contain data and code.
Introduction to JavaScript design patternsJeremy Duvall
Some 30 years ago software engineers began to incorporate some of the architect Christoper Alexander's design patterns work into their own, with the crecendo being the Gang of Four's "Design Patterns: Elements Of Reusable Object-Oriented Software" written in 1995. Understanding these common proven methodologies for solving problems can accelerate development, improve maintainability, and conjure better software almost magically. Being classless, it's often difficult to directly see how classical design patterns can map to more fluid languages like JavaScript--but the language has taken quite nicely to both classical patterns and even supported the invention of some novel, never seen before patterns.
This document provides an overview of object-oriented programming (OOP) concepts, including classes, visibility, encapsulation, inheritance, polymorphism, and abstraction. A class defines the structure and behavior of an object, and can contain both data and functions. Visibility determines which members can be accessed from inside or outside a class. Encapsulation wraps data and functions together, while inheritance allows classes to inherit attributes from parent classes. Polymorphism enables different implementations of methods with the same name. Abstraction hides implementation details and provides a public interface.
This document provides an overview of object-oriented programming (OOP) concepts including classes, visibility, encapsulation, inheritance, polymorphism, and abstraction. A class defines the structure and behavior of an object and includes both data and functions. Visibility determines which members can be accessed from within or outside the class. Encapsulation wraps data and functions into a single unit. Inheritance allows a subclass to inherit properties and behaviors from a parent class. Polymorphism enables classes to provide different implementations of methods with the same name. Abstraction hides implementation details and provides essential public methods to manipulate object data without knowing internal details.
Abstract classes allow for incomplete implementations and common functionality to be shared among subclasses, interfaces define a contract for methods without implementations, and both are useful for abstraction and polymorphism by defining types independently of their concrete implementations.
This document discusses nested classes in Java. It defines nested classes as classes defined within other classes. There are two main types - non-static nested classes and static nested classes. Non-static nested classes can access private members of the outer class and require an outer class instance, while static nested classes behave like regular classes and do not require an outer class instance. The document covers the different types of non-static nested classes and provides examples to illustrate their usage and properties. It also compares static and non-static nested classes and discusses the advantages and disadvantages of using nested classes.
Inheritance allows classes to inherit attributes and behaviors from other classes. In C++, inheritance is implemented using class derivation, where a derived class inherits from a base class. This allows code reuse as the derived class can reuse code from the base class. Access levels like public, private, and protected determine which members are accessible to derived classes and external code. Dynamic binding allows functions to be overridden in derived classes, so the correct implementation is called at runtime based on the object's actual type. Multiple inheritance allows a class to inherit from more than one base class, but this can cause ambiguities that need to be resolved.
This document provides a summary of key Java concepts and answers to common Java interview questions. It begins with an introduction explaining what the presentation covers. The bulk of the document consists of questions and detailed answers on topics like exceptions, abstract classes, strings, arrays, collections, inheritance and polymorphism.
OCP Java (OCPJP) 8 Exam Quick Reference CardHari kiran G
If you are preparing to appear for Oracle Certified Professional Java SE 8 Programmer (OCPJP 8) certification exam, this a reference card (sort of long cheat sheet) meant to help you. You may want to print this reference card for your easy and quick reference when you prepare for your exam.
This chapter discusses inheritance, polymorphism, abstract classes, interfaces, and composition in Java. It covers key concepts such as subclasses extending superclasses, overriding superclass methods, abstract classes and methods, interfaces defining common behaviors without implementations, and composition using one class as a member field of another class. The chapter objectives are to learn about these fundamental object-oriented programming concepts in Java.
5. OBJECT ORIENTED PROGRAMMING USING JAVA - INHERITANCE.pptAshwathGupta
Inheritance allows the creation of class hierarchies where subclasses inherit and extend the functionality of parent classes. The document discusses key concepts of inheritance in Java like constructors calling in order of derivation, using the super keyword, method overriding and dynamic dispatch, abstract classes and methods, and final keywords. It provides examples demonstrating multilevel inheritance, overriding methods, and abstract classes.
This document provides an overview of object-oriented programming (OOP) concepts in C#, including classes, objects, the class lifecycle, accessibility, static vs instance, inheritance, polymorphism, and encapsulation. It also addresses some common questions about overriding methods, overriding private methods, declaring override methods as static, and whether a class can be instantiated if its constructor is private. The document was presented by Eng. Medhat Dawoud and encourages contacting him with any other questions.
The document provides summaries of key Java concepts like static blocks, constructors, method overriding, the super keyword, method overloading vs overriding, abstract classes vs interfaces, why Java is platform independent, JIT compilers, bytecode, encapsulation, the differences between this() and super(), classes, objects, methods, and constructors in Java. It also answers common interview questions about the main() method, access modifiers, and the differences between C++ and Java.
This document provides an introduction to object-oriented programming (OOP) concepts. It defines OOP as a design philosophy that groups everything as self-sustainable objects. The key OOP concepts discussed are objects, classes, encapsulation, abstraction, inheritance, polymorphism, method overloading, method overriding, and access modifiers. Objects are instances of classes that can perform related activities, while classes are blueprints that describe objects. Encapsulation hides implementation details within classes, and abstraction focuses on what objects are rather than how they are implemented.
Class is a blueprint for creating object instances that share common attributes and behaviors. It defines the variables and methods that are common to all objects of that class. When an object is created from a class, it is said to be an instance of that class. Objects contain state in the form of attributes and behavior in the form of methods. Classes in Java can define access levels for variables and methods as public, private, protected, or without a specified level (default).
This document provides an overview of object-oriented programming concepts including abstraction, encapsulation, classes, objects, methods, constructors, inheritance, polymorphism, and interfaces. It explains that classes act as blueprints for objects, describing their data and behaviors. Objects are instances of classes that have state stored in attributes and behaviors defined by methods. Key features of OOP like inheritance, encapsulation, and polymorphism are discussed at a high level.
- Depression symptoms, how do you know you are depressed?, How to identify depression?
- Anxiety symptoms, How to identify anxiety
- Eating disorder
- Addiction illicit drugs
WHAT TO DO?
This document provides an introduction to Python programming for an artificial intelligence lab course. It covers downloading and installing Python and the Anaconda distribution, using Spyder as an IDE, variables and data types in Python, and basic concepts like indentation, variable naming conventions, and Python keywords. The goal is to prepare students to use Python for labs related to artificial intelligence topics.
The document discusses a workshop on object-oriented programming. It begins with introducing the speaker and providing his credentials and contact information. It then covers key topics in object-oriented programming including classes, objects, namespaces, functions, methods, constructors, destructors, and the four pillars of OOP - encapsulation, inheritance, polymorphism, and abstraction. For each topic, it provides definitions and examples to explain the concepts. It emphasizes that OOP is a programming paradigm based on objects that can contain data and code.
Introduction to JavaScript design patternsJeremy Duvall
Some 30 years ago software engineers began to incorporate some of the architect Christoper Alexander's design patterns work into their own, with the crecendo being the Gang of Four's "Design Patterns: Elements Of Reusable Object-Oriented Software" written in 1995. Understanding these common proven methodologies for solving problems can accelerate development, improve maintainability, and conjure better software almost magically. Being classless, it's often difficult to directly see how classical design patterns can map to more fluid languages like JavaScript--but the language has taken quite nicely to both classical patterns and even supported the invention of some novel, never seen before patterns.
This document provides an overview of object-oriented programming (OOP) concepts, including classes, visibility, encapsulation, inheritance, polymorphism, and abstraction. A class defines the structure and behavior of an object, and can contain both data and functions. Visibility determines which members can be accessed from inside or outside a class. Encapsulation wraps data and functions together, while inheritance allows classes to inherit attributes from parent classes. Polymorphism enables different implementations of methods with the same name. Abstraction hides implementation details and provides a public interface.
This document provides an overview of object-oriented programming (OOP) concepts including classes, visibility, encapsulation, inheritance, polymorphism, and abstraction. A class defines the structure and behavior of an object and includes both data and functions. Visibility determines which members can be accessed from within or outside the class. Encapsulation wraps data and functions into a single unit. Inheritance allows a subclass to inherit properties and behaviors from a parent class. Polymorphism enables classes to provide different implementations of methods with the same name. Abstraction hides implementation details and provides essential public methods to manipulate object data without knowing internal details.
Abstract classes allow for incomplete implementations and common functionality to be shared among subclasses, interfaces define a contract for methods without implementations, and both are useful for abstraction and polymorphism by defining types independently of their concrete implementations.
This document discusses nested classes in Java. It defines nested classes as classes defined within other classes. There are two main types - non-static nested classes and static nested classes. Non-static nested classes can access private members of the outer class and require an outer class instance, while static nested classes behave like regular classes and do not require an outer class instance. The document covers the different types of non-static nested classes and provides examples to illustrate their usage and properties. It also compares static and non-static nested classes and discusses the advantages and disadvantages of using nested classes.
Inheritance allows classes to inherit attributes and behaviors from other classes. In C++, inheritance is implemented using class derivation, where a derived class inherits from a base class. This allows code reuse as the derived class can reuse code from the base class. Access levels like public, private, and protected determine which members are accessible to derived classes and external code. Dynamic binding allows functions to be overridden in derived classes, so the correct implementation is called at runtime based on the object's actual type. Multiple inheritance allows a class to inherit from more than one base class, but this can cause ambiguities that need to be resolved.
This document provides a summary of key Java concepts and answers to common Java interview questions. It begins with an introduction explaining what the presentation covers. The bulk of the document consists of questions and detailed answers on topics like exceptions, abstract classes, strings, arrays, collections, inheritance and polymorphism.
OCP Java (OCPJP) 8 Exam Quick Reference CardHari kiran G
If you are preparing to appear for Oracle Certified Professional Java SE 8 Programmer (OCPJP 8) certification exam, this a reference card (sort of long cheat sheet) meant to help you. You may want to print this reference card for your easy and quick reference when you prepare for your exam.
This chapter discusses inheritance, polymorphism, abstract classes, interfaces, and composition in Java. It covers key concepts such as subclasses extending superclasses, overriding superclass methods, abstract classes and methods, interfaces defining common behaviors without implementations, and composition using one class as a member field of another class. The chapter objectives are to learn about these fundamental object-oriented programming concepts in Java.
5. OBJECT ORIENTED PROGRAMMING USING JAVA - INHERITANCE.pptAshwathGupta
Inheritance allows the creation of class hierarchies where subclasses inherit and extend the functionality of parent classes. The document discusses key concepts of inheritance in Java like constructors calling in order of derivation, using the super keyword, method overriding and dynamic dispatch, abstract classes and methods, and final keywords. It provides examples demonstrating multilevel inheritance, overriding methods, and abstract classes.
This document provides an overview of object-oriented programming (OOP) concepts in C#, including classes, objects, the class lifecycle, accessibility, static vs instance, inheritance, polymorphism, and encapsulation. It also addresses some common questions about overriding methods, overriding private methods, declaring override methods as static, and whether a class can be instantiated if its constructor is private. The document was presented by Eng. Medhat Dawoud and encourages contacting him with any other questions.
The document provides summaries of key Java concepts like static blocks, constructors, method overriding, the super keyword, method overloading vs overriding, abstract classes vs interfaces, why Java is platform independent, JIT compilers, bytecode, encapsulation, the differences between this() and super(), classes, objects, methods, and constructors in Java. It also answers common interview questions about the main() method, access modifiers, and the differences between C++ and Java.
This document provides an introduction to object-oriented programming (OOP) concepts. It defines OOP as a design philosophy that groups everything as self-sustainable objects. The key OOP concepts discussed are objects, classes, encapsulation, abstraction, inheritance, polymorphism, method overloading, method overriding, and access modifiers. Objects are instances of classes that can perform related activities, while classes are blueprints that describe objects. Encapsulation hides implementation details within classes, and abstraction focuses on what objects are rather than how they are implemented.
Class is a blueprint for creating object instances that share common attributes and behaviors. It defines the variables and methods that are common to all objects of that class. When an object is created from a class, it is said to be an instance of that class. Objects contain state in the form of attributes and behavior in the form of methods. Classes in Java can define access levels for variables and methods as public, private, protected, or without a specified level (default).
This document provides an overview of object-oriented programming concepts including abstraction, encapsulation, classes, objects, methods, constructors, inheritance, polymorphism, and interfaces. It explains that classes act as blueprints for objects, describing their data and behaviors. Objects are instances of classes that have state stored in attributes and behaviors defined by methods. Key features of OOP like inheritance, encapsulation, and polymorphism are discussed at a high level.
- Depression symptoms, how do you know you are depressed?, How to identify depression?
- Anxiety symptoms, How to identify anxiety
- Eating disorder
- Addiction illicit drugs
WHAT TO DO?
This document provides an introduction to Python programming for an artificial intelligence lab course. It covers downloading and installing Python and the Anaconda distribution, using Spyder as an IDE, variables and data types in Python, and basic concepts like indentation, variable naming conventions, and Python keywords. The goal is to prepare students to use Python for labs related to artificial intelligence topics.
This document discusses overloading stream insertion (<<) and extraction (>>) operators for user-defined classes like Complex. It shows how to define these operators as member functions or non-member friend functions to allow objects of the class to be written to or read from streams like cout and cin. It also briefly mentions overloading other binary operators like == and != for comparison.
This document proposes developing a computer application to classify common skin diseases from images in order to assist medical facilities in remote areas without access to skin specialists. The application would acquire skin images, classify the condition, and allow uploading classified images to a web app for further expert opinion. It would be designed to classify conditions like acne, scabies, psoriasis, eczema, and more. The document outlines requirements, approaches, a flow chart, and testing details for the proposed application.
The document discusses various types of filters that can be used to reduce noise in digital images, including mean filters, median filters, and order statistics filters. Mean filters include arithmetic, geometric, and harmonic filters, which reduce noise by calculating the mean pixel value within a neighborhood. Median filters select the median pixel value within a neighborhood to reduce salt and pepper noise while retaining edges. Adaptive filters modify their behavior based on statistical properties of local regions in order to better reduce noise without excessive blurring.
The document discusses noise models and methods for removing additive noise from digital images. It describes several types of noise that can affect images, such as Gaussian, impulse, uniform, Rayleigh, gamma and exponential noise. It also presents various noise filters that can be used to remove noise, including mean filters like arithmetic, geometric and harmonic filters, and order statistics filters such as median, max, min and midpoint filters. The filters aim to reduce noise while retaining image detail as much as possible.
This document discusses noise models and additive noise removal in digital image processing. It covers several types of noise that can affect images, including Gaussian, impulse, uniform, Rayleigh, gamma, exponential, and periodic noise. Various noise models are presented, such as definitions and equations for Gaussian, Rayleigh, gamma, exponential, uniform, and impulse noise. Examples of how different noise types affect images and histograms are also shown.
Introduction to machine learningunsupervised learningSardar Alam
The document provides an introduction to machine learning and discusses different types of machine learning algorithms including supervised and unsupervised learning. It provides examples of problems that could be addressed using supervised learning like regression to predict housing prices and classification to detect cancer. Unsupervised learning is used to discover hidden patterns in unlabeled data like grouping customer accounts or news articles.
The document discusses OpenGL texturing. It describes how textures are loaded and applied to geometry. Textures are loaded using LoadTexture, which reads in texture data from a file. Textures are then enabled and bound. Texture parameters like filtering and wrapping modes are also set. Texture coordinates are assigned to vertices to map portions of the texture onto the geometry. When finished, textures can be cleaned up by deleting them to free memory.
A matrix is an arrangement of numbers organized into rows and columns. It has a specific number of rows and columns called its dimensions. Each individual number in the matrix is called an element, which has a specific location defined by its row and column. A square matrix has the same number of rows and columns. Matrices are useful in computer graphics for transformations and are typically denoted with a capital letter indicating their dimensions. To be equal, two matrices must have the same dimensions and corresponding elements must be identical.
The 3D graphics rendering pipeline consists of 4 main stages: 1) vertex processing, 2) rasterization, 3) fragment processing, and 4) output merging. In vertex processing, transformations are applied to position objects in the scene and camera. Rasterization converts vertex data into fragments and performs operations like clipping and scan conversion. Fragment processing handles texture mapping and lighting. Output merging combines fragments and uses the z-buffer to remove hidden surfaces when displaying the final pixels.
The document discusses computer graphics hardware and GPU computing. It explains that GPUs have thousands of smaller cores that are optimized for parallel processing compared to CPUs which have a few cores for serial processing. GPU computing uses both the CPU and GPU together, with serial code running on the CPU and parallel code on the GPU. The document also covers topics like the CUDA platform, GPU specifications, raster displays, frame buffers, double buffering, 3D graphics pipelines, and the different types of transformations involved in 3D rendering like model, view and projection transforms.
Human eyes perceive 3D projections in 2D. Coordinate systems including 1D, 2D, and 3D Cartesian systems define locations using reference points and orthogonal axes. 3D systems use x, y, and z coordinates to locate points and define geometries in space, including volumes like cubes and spheres. Coordinate transformations allow changing between reference frames.
This document discusses 2D transformations including vector addition, dot products, cross products, translation, rotation, and scaling. Vector addition involves adding the x and y components of two vectors. The dot product of two vectors produces a scalar value based on the cosine of the angle between the vectors and can be used to determine if they are perpendicular. The cross product of two vectors produces a new vector perpendicular to both input vectors, determined by the right hand rule. Translation moves every point of an object by the same displacement amounts. Rotation rotates every point of an object by the same angle. Scaling enlarges or shrinks an object by a uniform scaling factor.
This document discusses the evolution of graphical user interface (GUI) capabilities in the Java programming language. It describes the Abstract Window Toolkit (AWT) introduced in JDK 1.0, which provided basic cross-platform GUI functionality but had limitations. JDK 1.1 improved on AWT with an event delegation model. JDK 1.2 introduced Swing, a richer GUI library that better integrated with native operating system look and feels. Swing components are lightweight compared to heavyweight AWT components. The document also covers GUI component classes, layout managers, menus, labels and event handling in Java GUI programming.
This document discusses arrays, strings, and string buffers in Java. It covers:
- Creating and initializing arrays, including single and multi-dimensional arrays
- Common string operations like length(), concatenation, character extraction, comparison, searching, and modifying case
- Constructing and modifying mutable string buffers, which can be changed unlike immutable string objects
- The main method parameter which is an array of command line arguments
There are three main editions of Java: Java SE (Standard Edition), Java EE (Enterprise Edition), and Java ME (Micro Edition). Java SE is for general use and desktop applications. Java EE adds enterprise features like EJBs, JSP, and web services for developing enterprise applications. Java ME is for small devices like phones. The document then discusses Java concepts like classes, objects, fields, methods, constructors, and data types. It provides examples of how to define and use classes, objects, and methods in Java.
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
Preparing Non - Technical Founders for Engaging a Tech AgencyISH Technologies
Preparing non-technical founders before engaging a tech agency is crucial for the success of their projects. It starts with clearly defining their vision and goals, conducting thorough market research, and gaining a basic understanding of relevant technologies. Setting realistic expectations and preparing a detailed project brief are essential steps. Founders should select a tech agency with a proven track record and establish clear communication channels. Additionally, addressing legal and contractual considerations and planning for post-launch support are vital to ensure a smooth and successful collaboration. This preparation empowers non-technical founders to effectively communicate their needs and work seamlessly with their chosen tech agency.Visit our site to get more details about this. Contact us today www.ishtechnologies.com.au
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
1. Inheritance!
The objectives of this chapter are:!
!
! To explore the concept and implications of inheritance!
! Polymorphism!
! To define the syntax of inheritance in Java!
! To understand the class hierarchy of Java!
! To examine the effect of inheritance on constructors!
2. Terminology!
! Inheritance is a fundamental Object Oriented concept!
!
! A class can be defined as a "subclass" of another class.!
! The subclass inherits all data attributes of its superclass!
! The subclass inherits all methods of its superclass!
! The subclass inherits all associations of its superclass!
!
! The subclass can:!
! Add new functionality!
! Use inherited functionality!
! Override inherited functionality!
Person
- name: String
- dob: Date
Employee
- employeeID: int
- salary: int
- startDate: Date
superclass:
subclass:
3. What really happens?!
! When an object is created using new, the system must
allocate enough memory to hold all its instance variables.!
! This includes any inherited instance variables!
!
! In this example, we can say that an Employee "is a kind of"
Person. !
! An Employee object inherits all of the attributes, methods and
associations of Person!
Person
- name: String
- dob: Date
Employee
- employeeID: int
- salary: int
- startDate: Date
Person
name = "John Smith"
dob = Jan 13, 1954
Employee
name = "Sally Halls"
dob = Mar 15, 1968
employeeID = 37518
salary = 65000
startDate = Dec 15,
2000
is a kind of
4. Inheritance in Java!
! Inheritance is declared using the "extends" keyword!
! If inheritance is not defined, the class extends a class called Object!
!
Person
- name: String
- dob: Date
Employee
- employeeID: int
- salary: int
- startDate: Date
public class Person!
{!
!private String name;!
!private Date dob;!
![...]!
public class Employee extends Person!
{!
!private int employeID;!
!private int salary;!
!private Date startDate;!
![...]!
Employee anEmployee = new Employee();!
5. Inheritance Hierarchy!
! Each Java class has one (and only one) superclass.!
! C++ allows for multiple inheritance!
!
! Inheritance creates a class hierarchy!
! Classes higher in the hierarchy are more general and more abstract!
! Classes lower in the hierarchy are more specific and concrete!
! There is no limit to the Class
number of subclasses a class
can have!
!
! There is no limit to the depth
of the class tree.!
Class
Class
Class
Class
Class
Class
Class
6. The class called Object!
! At the very top of the inheritance tree is a class called Object!
!
! All Java classes inherit from Object.!
! All objects have a common ancestor!
! This is different from C++!
!
! The Object class is defined in the java.lang package!
! Examine it in the Java API Specification!
Object
7. Constructors and Initialization!
! Classes use constructors to initialize instance variables!
! When a subclass object is created, its constructor is called.!
! It is the responsibility of the subclass constructor to invoke the
appropriate superclass constructors so that the instance variables
defined in the superclass are properly initialized!
!
! Superclass constructors can be called using the "super"
keyword in a manner similar to "this"!
! It must be the first line of code in the constructor!
!
! If a call to super is not made, the system will automatically
attempt to invoke the no-argument constructor of the
superclass.!
9. Method Overriding!
! Subclasses inherit all methods from their superclass!
! Sometimes, the implementation of the method in the superclass does
not provide the functionality required by the subclass.!
! In these cases, the method must be overridden.!
!
! To override a method, provide an implementation in the
subclass.!
! The method in the subclass MUST have the exact same signature as
the method it is overriding.!
!
!
12. Object References and Inheritance!
! Inheritance defines "a kind of" relationship.!
! In the previous example, OverdraftAccount "is a kind of" BankAccount!
!
! Because of this relationship, programmers can "substitute"
object references.!
! A superclass reference can refer to an instance of the superclass OR an
instance of ANY class which inherits from the superclass.!
!
! BankAccount anAccount = new BankAccount(123456, "Craig");!
!
BankAccount account1 = new OverdraftAccount(3323, "John", 1000.0);!
anAccount
BankAccount
name = "Craig"
accountNumber = 123456
account1
OverdraftAccount
name = "John"
accountNumber = 3323
limit = 1000.0
13. Polymorphism!
! In the previous slide, the two variables are defined to have
the same type at compile time: BankAccount!
! However, the types of objects they are referring to at runtime are
different!
!
! What happens when the withdraw method is invoked on each
object?!
! anAccount refers to an instance of BankAccount. Therefore, the
withdraw method defined in BankAccount is invoked.!
! account1 refers to an instance of OverdraftAccount. Therefore, the
withdraw method defined in OverdraftAccount is invoked.!
!
! Polymorphism is: The method being invoked on an object is
determined AT RUNTIME and is based on the type of the
object receiving the message.!
14. Final Methods and Final Classes!
! Methods can be qualified with the final modifier!
! Final methods cannot be overridden.!
! This can be useful for security purposes.!
public final boolean validatePassword(String username, String Password)!
{!
![...]!
! Classes can be qualified with the final modifier!
! The class cannot be extended!
! This can be used to improve performance. Because there an be no
subclasses, there will be no polymorphic overhead at runtime.!
public final class Color!
{!
![...]!
15. Virtual Functions!
! Every non-static method in JAVA is by default virtual
method!
! Except final and private methods. !
! The methods which cannot be inherited for polymorphic
behavior is not a virtual method.!
! In Java there is no keyword names virtual!
16. Review!
! What is inheritance? What is a superclass? What is a subclass?!
! Which class is at the top of the class hierarchy in Java?!
! What are the constructor issues surrounding inheritance?!
! What is method overriding? What is polymorphism? How are they
related?!
! What is a final method? What is a final class?!
18. 18
Abstract methods
" You can declare an object without defining it:
Person p;
" Similarly, you can declare a method without
defining it:
public abstract void draw(int size);
– Notice that the body of the method is missing
" A method that has been declared but not defined is
an abstract method
19. 19
Abstract classes I
" Any class containing an abstract method is an
abstract class
" You must declare the class with the keyword
abstract:
abstract class MyClass {...}
" An abstract class is incomplete
– It has “missing” method bodies
" You cannot instantiate (create a new instance of) an
abstract class
20. 20
Abstract classes II
" You can extend (subclass) an abstract class
– If the subclass defines all the inherited abstract methods,
it is “complete” and can be instantiated
– If the subclass does not define all the inherited abstract
methods, it too must be abstract
" You can declare a class to be abstract even if it
does not contain any abstract methods
– This prevents the class from being instantiated
21. Why have abstract classes?
" Suppose you wanted to create a class Shape, with
subclasses Oval, Rectangle, Triangle, Hexagon,
etc.
" You don’t want to allow creation of a “Shape”
– Only particular shapes make sense, not generic ones
– If Shape is abstract, you can’t create a new Shape
– You can create a new Oval, a new Rectangle, etc.
" Abstract classes are good for defining a general
category containing specific, “concrete” classes
21
22. 22
An example abstract class
" public abstract class Animal {
abstract int eat();
abstract void breathe();
}
" This class cannot be instantiated
" Any non-abstract subclass of Animal must provide
the eat() and breathe() methods
23. Why have abstract methods?
23
" Suppose you have a class Shape, but it isn’t abstract
– Shape should not have a draw() method
– Each subclass of Shape should have a draw() method
" Now suppose you have a variable Shape figure; where figure contains some
subclass object (such as a Star)
– It is a syntax error to say figure.draw(), because the Java compiler can’t tell in
advance what kind of value will be in the figure variable
– A class “knows” its superclass, but doesn’t know its subclasses
– An object knows its class, but a class doesn’t know its objects
" Solution: Give Shape an abstract method draw()
– Now the class Shape is abstract, so it can’t be instantiated
– The figure variable cannot contain a (generic) Shape, because it is impossible to
create one
– Any object (such as a Star object) that is a (kind of) Shape will have the draw()
method
– The Java compiler can depend on figure.draw() being a legal call and does not give a
syntax error
24. 24
A problem
" class Shape { ... }
" class Star extends Shape {
void draw() { ... }
...
}
" class Crescent extends Shape {
void draw() { ... }
...
}
" Shape someShape = new Star();
– This is legal, because a Star is a Shape
" someShape.draw();
– This is a syntax error, because some Shape might not have a draw() method
– Remember: A class knows its superclass, but not its subclasses
25. 25
A solution
" abstract class Shape {
abstract void draw();
}
" class Star extends Shape {
void draw() { ... }
...
}
" class Crescent extends Shape {
void draw() { ... }
...
}
" Shape someShape = new Star();
– This is legal, because a Star is a Shape
– However, Shape someShape = new Shape(); is no longer legal
" someShape.draw();
– This is legal, because every actual instance must have a draw() method
26. 26
Interfaces
" An interface declares (describes) methods but does not supply
bodies for them
interface KeyListener {
public void keyPressed(KeyEvent e);
public void keyReleased(KeyEvent e);
public void keyTyped(KeyEvent e);
}
" All the methods are implicitly public and abstract
– You can add these qualifiers if you like, but why bother?
" You cannot instantiate an interface
– An interface is like a very abstract class—none of its methods are defined
" An interface may also contain constants (final variables)
27. 27
Designing interfaces
" Most of the time, you will use Sun-supplied Java interfaces
" Sometimes you will want to design your own
" You would write an interface if you want classes of various
types to all have a certain set of capabilities
" For example, if you want to be able to create animated displays
of objects in a class, you might define an interface as:
– public interface Animatable {
install(Panel p);
display();
}
" Now you can write code that will display any Animatable
class in a Panel of your choice, simply by calling these
methods
28. Implementing an interface I
" You extend a class, but you implement an
interface
" A class can only extend (subclass) one other class,
but it can implement as many interfaces as you like
28
" Example:
class MyListener
implements KeyListener, ActionListener
{ … }
29. Implementing an interface II
" When you say a class implements an interface,
you are promising to define all the methods that
were declared in the interface
" Example:
class MyKeyListener implements KeyListener {
public void keyPressed(KeyEvent e) {...};
public void keyReleased(KeyEvent e) {...};
public void keyTyped(KeyEvent e) {...};
29
}
– The “...” indicates actual code that you must supply
" Now you can create a new MyKeyListener
30. Partially implementing an Interface
" It is possible to define some but not all of the methods
defined in an interface:
abstract class MyKeyListener implements KeyListener {
30
public void keyTyped(KeyEvent e) {...};
}
" Since this class does not supply all the methods it has
promised, it is an abstract class
" You must label it as such with the keyword abstract
" You can even extend an interface (to add methods):
– interface FunkyKeyListener extends KeyListener { ... }
31. 31
What are interfaces for?
" Reason 1: A class can only extend one other
class, but it can implement multiple interfaces
– This lets the class fill multiple “roles”
– In writing Applets, it is common to have one class
implement several different listeners
– Example:
class MyApplet extends Applet
implements ActionListener, KeyListener {
...
}
" Reason 2: You can write methods that work for
more than one kind of class
32. 32
How to use interfaces
" You can write methods that work with more than one class
" interface RuleSet { boolean isLegal(Move m, Board b);
void makeMove(Move m); }
– Every class that implements RuleSet must have these methods
" class CheckersRules implements RuleSet { // one implementation
public boolean isLegal(Move m, Board b) { ... }
public void makeMove(Move m) { ... }
}
" class ChessRules implements RuleSet { ... } // another implementation
" class LinesOfActionRules implements RuleSet { ... } // and another
" RuleSet rulesOfThisGame = new ChessRules();
– This assignment is legal because a rulesOfThisGame object is a RuleSet object
" if (rulesOfThisGame.isLegal(m, b)) { makeMove(m); }
– This statement is legal because, whatever kind of RuleSet object rulesOfThisGame is, it
must have isLegal and makeMove methods
33. 33
Interfaces, again
" When you implement an interface, you promise to
define all the functions it declares
" There can be a lot of methods
interface KeyListener {
public void keyPressed(KeyEvent e);
public void keyReleased(KeyEvent e);
public void keyTyped(KeyEvent e);
}
" What if you only care about a couple of these
methods?
34. 34
Adapter classes
" Solution: use an adapter class
" An adapter class implements an interface and provides
empty method bodies
class KeyAdapter implements KeyListener {
public void keyPressed(KeyEvent e) { };
public void keyReleased(KeyEvent e) { };
public void keyTyped(KeyEvent e) { };
}
" You can override only the methods you care about
" This isn’t elegant, but it does work
" Java provides a number of adapter classes
35. 35
Vocabulary
" abstract method—a method which is declared but
not defined (it has no method body)
" abstract class—a class which either (1) contains
abstract methods, or (2) has been declared
abstract
" instantiate—to create an instance (object) of a
class
" interface—similar to a class, but contains only
abstract methods (and possibly constants)
" adapter class—a class that implements an
interface but has only empty method bodies
36. 36
The End
Complexity has nothing to do with intelligence, simplicity does.
— Larry Bossidy
Perfection is achieved, not when there is nothing more to add, but
when there is nothing left to take away.
— Antoine de Saint Exupery