This document discusses key concepts in Java including abstraction, encapsulation, inheritance, polymorphism, and interfaces. It defines these concepts and provides examples. Abstraction hides unnecessary details and shows essential information. Encapsulation wraps data and functions into a single unit. Inheritance allows a subclass to acquire properties of another class. Polymorphism supports method overloading and overriding. Interfaces can be used to implement inheritance between unrelated classes and specify what a class must do without defining how. The document also discusses access specifiers, modifiers, variables, literals, and static and final keywords.
This document provides an overview of Java fundamentals including classes, objects, encapsulation, abstraction, inheritance, polymorphism and other core OOP concepts. Key points covered include:
- Classes contain variable declarations and method definitions while objects have state, behavior and identity.
- Encapsulation is achieved by declaring class variables as private and providing public get and set methods.
- Abstraction hides certain details and shows only essential information to the user using abstract classes and interfaces.
- Inheritance allows classes to extend functionality from other classes in a hierarchical manner to achieve code reuse.
- Polymorphism allows a single action to be performed in different ways depending on the object used.
Abstraction in Java allows hiding implementation details and exposing only essential properties and behaviors to users. This is achieved through abstract classes and interfaces. Abstract classes can contain both abstract and concrete methods, while interfaces contain only abstract methods. Any subclass of an abstract class must implement all abstract methods to be instantiable, or itself be declared abstract. Abstract classes allow partial implementation to be inherited and completed in subclasses.
The document discusses key concepts in Java including abstraction, encapsulation, inheritance, polymorphism, interfaces, abstract classes, collections, threads, and exceptions. It defines each concept and provides examples. Abstraction hides unnecessary details, encapsulation wraps data within a class, inheritance allows subclasses to inherit features of the parent class, and polymorphism allows one name to refer to different implementations. Interfaces are used for non-related classes to implement common behaviors, while abstract classes provide partial implementations for subclasses to complete. Collections organize objects into groups, and threads allow concurrent execution of tasks. Exceptions handle runtime errors.
The document discusses different types of inner classes in Java including regular inner classes, method-local inner classes, anonymous inner classes, and static nested classes. Regular inner classes have access to outer class members and require an outer class instance. Method-local inner classes can only be instantiated within their defining method. Anonymous inner classes do not have a name and are instantiated at creation. Static nested classes are not inner classes and do not have implicit access to outer class members.
This document discusses key object-oriented programming concepts including encapsulation, inheritance, polymorphism, abstract classes, and interfaces. It provides examples of how encapsulation hides implementation details and inheritance allows classes to inherit properties from superclasses. Polymorphism allows objects to take on multiple forms through inheritance. Abstract classes cannot be instantiated directly but provide a common definition that concrete subclasses implement. Interfaces define behaviors for classes to implement but do not provide implementations.
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.
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.
Friend functions allow non-member functions to access private and protected members of a class. Inline functions avoid function call overhead by copying the code into the calling function. The this pointer is an implicit parameter that provides access to the object from within member functions. Static members exist only once per class rather than for each object. Inheritance allows classes to inherit attributes and behaviors from other classes in a hierarchy. Polymorphism allows functions to take different implementations based on the runtime type of an object. Encapsulation binds data and functions that operate on that data together within a class to hide implementation details.
This document discusses object-oriented programming concepts including inheritance, polymorphism, interfaces, and abstract classes/methods. Inheritance allows a derived class to extend a base class, adding new properties and methods. Polymorphism enables an object to take on multiple forms through method overriding. Interfaces specify methods a class must implement, while abstract classes can contain abstract methods without implementation and both cannot be instantiated. The document provides examples and definitions of these concepts.
Classes in Java represent templates for objects that share common properties and behaviors. A class defines the blueprint for objects, but does not use memory itself. Objects are instances of classes that represent real-world entities. For example, Dog is a class while Tommy is an object of the Dog class. Classes contain variables that store object data and methods that define object behaviors. Objects are declared by specifying the class name and are initialized using the new operator, which allocates memory and invokes the class constructor.
This document provides an overview of inheritance and interfaces in Java programming. It discusses key concepts like subclasses and superclasses, method overriding, abstract classes, polymorphism, and interfaces. It also covers the List interface, lambda expressions, and differences between abstract classes and interfaces. The document is the syllabus for a CAP615 Programming in Java course focusing on inheritance and interfaces.
Inheritance in Java allows one class to acquire properties and behaviors of another class. This allows code reusability and method overriding to achieve runtime polymorphism. There are three types of inheritance: single, multilevel, and hierarchical. Access modifiers like private, default, protected, and public control the scope and accessibility of classes, methods, and fields. Method overriding provides a specific implementation of a method defined in the parent class.
Java supports key object-oriented programming concepts like abstraction, encapsulation, inheritance and polymorphism. Abstraction hides unnecessary details, encapsulation wraps data and functions into a class, inheritance allows classes to inherit attributes and behaviors from parent classes, and polymorphism allows one interface to multiple forms. Java also uses bytecode, JIT compilation, and dynamic binding. Interfaces allow classes to implement common behaviors without sharing an inheritance relationship. Abstract classes support inheritance and require subclasses to implement abstract methods.
Importing a class allows it to be used without fully qualifying its name, while extending a class creates a subclass that inherits fields and methods. Importing does not change the program structure, while extending adds the extended class's functionality and allows overriding methods. The key differences are that importing uses the "has-a" relationship and instantiates with "new", while extending uses the "is-a" relationship and subclasses with "extends".
This document provides an overview of object-oriented programming (OOP) concepts including class and object, encapsulation, inheritance, polymorphism, interfaces, delegates, and access modifiers. It discusses how classes define objects, encapsulation binds data and methods into entities, inheritance creates new classes from existing ones, polymorphism allows different implementations of methods, interfaces define groups of related functionalities, delegates refer to methods, and access modifiers control visibility. Namespaces are used to organize code into unique scopes.
This document discusses packages and interfaces in Java. It covers:
- Packages organize related classes and provide encapsulation. Interfaces define methods without implementation.
- Packages and interfaces give greater control over program organization.
- Classes in a package are accessed through the package name and can control access. Namespaces avoid collisions.
- Interfaces define methods without bodies. Classes implement interfaces by providing method bodies. Interface references allow polymorphism.
- Variables in interfaces are public, static, and final constants available to implementing classes. Interfaces can extend other interfaces.
The document discusses encapsulation in object-oriented programming, which involves hiding data within a class and only allowing it to be accessed via the class's methods, in order to protect the data from accidental or malicious changes and allow the internal implementation to change without affecting other code; it also covers the different access levels for classes, members, and packages using modifiers like public, private, and protected. Encapsulation provides benefits like flexibility to change a class's implementation without breaking dependent code and control over how data is accessed and stored within a class.
This document discusses Java methods, encapsulation, and classes. It covers topics such as using methods, passing arguments to methods, overloading methods, access control and encapsulation, overloading constructors, nested and inner classes, and static methods and variables. Constructors cannot return values but implicitly return an instance of the class. Nested classes can be static or non-static inner classes. Static methods can be called without creating an object while instance methods can access instance variables and static methods require an object reference.
This document discusses encapsulation in object-oriented programming. Encapsulation involves enclosing data and functions together within a class and restricting access to that data. The document defines encapsulation and explains how it is used to hide implementation details and bind data to a single unit. It also discusses different access specifiers like public, private, protected, internal, and protected internal and how they control access to variables and methods within and outside of classes.
This document discusses encapsulation in object-oriented programming. Encapsulation involves enclosing data and functions together within a class and restricting access to that data. The document defines encapsulation and explains how it is used to hide implementation details and bind data to a single unit. It also discusses different access specifiers like public, private, protected, internal, and protected internal and how they control access to variables and methods within and outside of classes.
Master of Computer Application (MCA) – Semester 4 MC0078Aravind NC
An interface is a specification for methods that a class must implement, while an abstract class can contain both implemented and non-implemented methods. The main differences are that interface methods are implicitly abstract, variables in interfaces are final by default, and interfaces can only extend other interfaces while abstract classes can extend classes and implement interfaces. Exception handling in Java uses try/catch blocks to handle exceptions, with checked exceptions requiring handling at compile time. Abstract classes are incomplete classes that cannot be instantiated directly but can serve as base classes, while object adapters use delegation to adapt existing classes to new interfaces. Sockets in Java allow reading/writing between client and server programs, with the server creating a ServerSocket to listen for client connections.
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...parmarjuli1412
The document provides an overview of therapeutic communication, emphasizing its importance in nursing to address patient needs and establish effective relationships. THERAPEUTIC COMMUNICATION included some topics like introduction of COMMUNICATION, definition, types, process of communication, definition therapeutic communication, goal, techniques of therapeutic communication, non-therapeutic communication, few ways to improved therapeutic communication, characteristics of therapeutic communication, barrier of THERAPEUTIC RELATIONSHIP, introduction of interpersonal relationship, types of IPR, elements/ dynamics of IPR, introduction of therapeutic nurse patient relationship, definition, purpose, elements/characteristics , and phases of therapeutic communication, definition of Johari window, uses, what actually model represent and its areas, THERAPEUTIC IMPASSES and its management in 5th semester Bsc. nursing and 2nd GNM students
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfChalaKelbessa
This is Forestry Exit Exam Model for 2025 from Department of Forestry at Wollega University, Gimbi Campus.
The exam contains forestry courses such as Dendrology, Forest Seed and Nursery Establishment, Plantation Establishment and Management, Silviculture, Forest Mensuration, Forest Biometry, Agroforestry, Biodiversity Conservation, Forest Business, Forest Fore, Forest Protection, Forest Management, Wood Processing and others that are related to Forestry.
More Related Content
Similar to object oriented programming unit two ppt (20)
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.
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.
Friend functions allow non-member functions to access private and protected members of a class. Inline functions avoid function call overhead by copying the code into the calling function. The this pointer is an implicit parameter that provides access to the object from within member functions. Static members exist only once per class rather than for each object. Inheritance allows classes to inherit attributes and behaviors from other classes in a hierarchy. Polymorphism allows functions to take different implementations based on the runtime type of an object. Encapsulation binds data and functions that operate on that data together within a class to hide implementation details.
This document discusses object-oriented programming concepts including inheritance, polymorphism, interfaces, and abstract classes/methods. Inheritance allows a derived class to extend a base class, adding new properties and methods. Polymorphism enables an object to take on multiple forms through method overriding. Interfaces specify methods a class must implement, while abstract classes can contain abstract methods without implementation and both cannot be instantiated. The document provides examples and definitions of these concepts.
Classes in Java represent templates for objects that share common properties and behaviors. A class defines the blueprint for objects, but does not use memory itself. Objects are instances of classes that represent real-world entities. For example, Dog is a class while Tommy is an object of the Dog class. Classes contain variables that store object data and methods that define object behaviors. Objects are declared by specifying the class name and are initialized using the new operator, which allocates memory and invokes the class constructor.
This document provides an overview of inheritance and interfaces in Java programming. It discusses key concepts like subclasses and superclasses, method overriding, abstract classes, polymorphism, and interfaces. It also covers the List interface, lambda expressions, and differences between abstract classes and interfaces. The document is the syllabus for a CAP615 Programming in Java course focusing on inheritance and interfaces.
Inheritance in Java allows one class to acquire properties and behaviors of another class. This allows code reusability and method overriding to achieve runtime polymorphism. There are three types of inheritance: single, multilevel, and hierarchical. Access modifiers like private, default, protected, and public control the scope and accessibility of classes, methods, and fields. Method overriding provides a specific implementation of a method defined in the parent class.
Java supports key object-oriented programming concepts like abstraction, encapsulation, inheritance and polymorphism. Abstraction hides unnecessary details, encapsulation wraps data and functions into a class, inheritance allows classes to inherit attributes and behaviors from parent classes, and polymorphism allows one interface to multiple forms. Java also uses bytecode, JIT compilation, and dynamic binding. Interfaces allow classes to implement common behaviors without sharing an inheritance relationship. Abstract classes support inheritance and require subclasses to implement abstract methods.
Importing a class allows it to be used without fully qualifying its name, while extending a class creates a subclass that inherits fields and methods. Importing does not change the program structure, while extending adds the extended class's functionality and allows overriding methods. The key differences are that importing uses the "has-a" relationship and instantiates with "new", while extending uses the "is-a" relationship and subclasses with "extends".
This document provides an overview of object-oriented programming (OOP) concepts including class and object, encapsulation, inheritance, polymorphism, interfaces, delegates, and access modifiers. It discusses how classes define objects, encapsulation binds data and methods into entities, inheritance creates new classes from existing ones, polymorphism allows different implementations of methods, interfaces define groups of related functionalities, delegates refer to methods, and access modifiers control visibility. Namespaces are used to organize code into unique scopes.
This document discusses packages and interfaces in Java. It covers:
- Packages organize related classes and provide encapsulation. Interfaces define methods without implementation.
- Packages and interfaces give greater control over program organization.
- Classes in a package are accessed through the package name and can control access. Namespaces avoid collisions.
- Interfaces define methods without bodies. Classes implement interfaces by providing method bodies. Interface references allow polymorphism.
- Variables in interfaces are public, static, and final constants available to implementing classes. Interfaces can extend other interfaces.
The document discusses encapsulation in object-oriented programming, which involves hiding data within a class and only allowing it to be accessed via the class's methods, in order to protect the data from accidental or malicious changes and allow the internal implementation to change without affecting other code; it also covers the different access levels for classes, members, and packages using modifiers like public, private, and protected. Encapsulation provides benefits like flexibility to change a class's implementation without breaking dependent code and control over how data is accessed and stored within a class.
This document discusses Java methods, encapsulation, and classes. It covers topics such as using methods, passing arguments to methods, overloading methods, access control and encapsulation, overloading constructors, nested and inner classes, and static methods and variables. Constructors cannot return values but implicitly return an instance of the class. Nested classes can be static or non-static inner classes. Static methods can be called without creating an object while instance methods can access instance variables and static methods require an object reference.
This document discusses encapsulation in object-oriented programming. Encapsulation involves enclosing data and functions together within a class and restricting access to that data. The document defines encapsulation and explains how it is used to hide implementation details and bind data to a single unit. It also discusses different access specifiers like public, private, protected, internal, and protected internal and how they control access to variables and methods within and outside of classes.
This document discusses encapsulation in object-oriented programming. Encapsulation involves enclosing data and functions together within a class and restricting access to that data. The document defines encapsulation and explains how it is used to hide implementation details and bind data to a single unit. It also discusses different access specifiers like public, private, protected, internal, and protected internal and how they control access to variables and methods within and outside of classes.
Master of Computer Application (MCA) – Semester 4 MC0078Aravind NC
An interface is a specification for methods that a class must implement, while an abstract class can contain both implemented and non-implemented methods. The main differences are that interface methods are implicitly abstract, variables in interfaces are final by default, and interfaces can only extend other interfaces while abstract classes can extend classes and implement interfaces. Exception handling in Java uses try/catch blocks to handle exceptions, with checked exceptions requiring handling at compile time. Abstract classes are incomplete classes that cannot be instantiated directly but can serve as base classes, while object adapters use delegation to adapt existing classes to new interfaces. Sockets in Java allow reading/writing between client and server programs, with the server creating a ServerSocket to listen for client connections.
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...parmarjuli1412
The document provides an overview of therapeutic communication, emphasizing its importance in nursing to address patient needs and establish effective relationships. THERAPEUTIC COMMUNICATION included some topics like introduction of COMMUNICATION, definition, types, process of communication, definition therapeutic communication, goal, techniques of therapeutic communication, non-therapeutic communication, few ways to improved therapeutic communication, characteristics of therapeutic communication, barrier of THERAPEUTIC RELATIONSHIP, introduction of interpersonal relationship, types of IPR, elements/ dynamics of IPR, introduction of therapeutic nurse patient relationship, definition, purpose, elements/characteristics , and phases of therapeutic communication, definition of Johari window, uses, what actually model represent and its areas, THERAPEUTIC IMPASSES and its management in 5th semester Bsc. nursing and 2nd GNM students
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfChalaKelbessa
This is Forestry Exit Exam Model for 2025 from Department of Forestry at Wollega University, Gimbi Campus.
The exam contains forestry courses such as Dendrology, Forest Seed and Nursery Establishment, Plantation Establishment and Management, Silviculture, Forest Mensuration, Forest Biometry, Agroforestry, Biodiversity Conservation, Forest Business, Forest Fore, Forest Protection, Forest Management, Wood Processing and others that are related to Forestry.
Artificial intelligence Presented by JM.jmansha170
AI (Artificial Intelligence) :
"AI is the ability of machines to mimic human intelligence, such as learning, decision-making, and problem-solving."
Important Points about AI:
1. Learning – AI can learn from data (Machine Learning).
2. Automation – It helps automate repetitive tasks.
3. Decision Making – AI can analyze and make decisions faster than humans.
4. Natural Language Processing (NLP) – AI can understand and generate human language.
5. Vision & Recognition – AI can recognize images, faces, and patterns.
6. Used In – Healthcare, finance, robotics, education, and more.
Owner By:
Name : Junaid Mansha
Work : Web Developer and Graphics Designer
Contact us : +92 322 2291672
Email : [email protected]
Adam Grant: Transforming Work Culture Through Organizational PsychologyPrachi Shah
This presentation explores the groundbreaking work of Adam Grant, renowned organizational psychologist and bestselling author. It highlights his key theories on giving, motivation, leadership, and workplace dynamics that have revolutionized how organizations think about productivity, collaboration, and employee well-being. Ideal for students, HR professionals, and leadership enthusiasts, this deck includes insights from his major works like Give and Take, Originals, and Think Again, along with interactive elements for enhanced engagement.
Parenting Teens: Supporting Trust, resilience and independencePooky Knightsmith
For more information about my speaking and training work, visit: https://www.pookyknightsmith.com/speaking/
SESSION OVERVIEW:
Parenting Teens: Supporting Trust, Resilience & Independence
The teenage years bring new challenges—for teens and for you. In this practical session, we’ll explore how to support your teen through emotional ups and downs, growing independence, and the pressures of school and social life.
You’ll gain insights into the teenage brain and why boundary-pushing is part of healthy development, along with tools to keep communication open, build trust, and support emotional resilience. Expect honest ideas, relatable examples, and space to connect with other parents.
By the end of this session, you will:
• Understand how teenage brain development affects behaviour and emotions
• Learn ways to keep communication open and supportive
• Explore tools to help your teen manage stress and bounce back from setbacks
• Reflect on how to encourage independence while staying connected
• Discover simple strategies to support emotional wellbeing
• Share experiences and ideas with other parents
Completed Sunday 6/8. For Weekend 6/14 & 15th. (Fathers Day Weekend US.) These workshops are also timeless for future students TY. No admissions needed.
A 9th FREE WORKSHOP
Reiki - Yoga
“Intuition-II, The Chakras”
Your Attendance is valued.
We hit over 5k views for Spring Workshops and Updates-TY.
Thank you for attending our workshops.
If you are new, do welcome.
Grad Students: I am planning a Reiki-Yoga Master Course (As a package). I’m Fusing both together.
This will include the foundation of each practice. Our Free Workshops can be used with any Reiki Yoga training package. Traditional Reiki does host rules and ethics. Its silent and within the JP Culture/Area/Training/Word of Mouth. It allows remote healing but there’s limits As practitioners and masters, we are not allowed to share certain secrets/tools. Some content is designed only for “Masters”. Some yoga are similar like the Kriya Yoga-Church (Vowed Lessons). We will review both Reiki and Yoga (Master tools) in the Course upcoming.
S9/This Week’s Focus:
* A continuation of Intuition-2 Development. We will review the Chakra System - Our temple. A misguided, misused situation lol. This will also serve Attunement later.
Thx for tuning in. Your time investment is valued. I do select topics related to our timeline and community. For those seeking upgrades or Reiki Levels. Stay tuned for our June packages. It’s for self employed/Practitioners/Coaches…
Review & Topics:
* Reiki Is Japanese Energy Healing used Globally.
* Yoga is over 5k years old from India. It hosts many styles, teacher versions, and it’s Mainstream now vs decades ago.
* Anything of the Holistic, Wellness Department can be fused together. My origins are Alternative, Complementary Medicine. In short, I call this ND. I am also a metaphysician. I learnt during the 90s New Age Era. I forget we just hit another wavy. It’s GenZ word of Mouth, their New Age Era. WHOA, History Repeats lol. We are fusing together.
* So, most of you have experienced your Spiritual Awakening. However; The journey wont be perfect. There will be some roller coaster events. The perks are: We are in a faster Spiritual Zone than the 90s. There’s more support and information available.
(See Presentation for all sections, THX AGAIN.)
Smart Borrowing: Everything You Need to Know About Short Term Loans in Indiafincrifcontent
Short term loans in India are becoming a go-to financial solution for individuals needing quick access to funds without long-term commitments. With fast approval, minimal documentation, and flexible tenures, these loans are ideal for handling emergencies, unexpected bills, or short-term goals. Understanding key aspects like short term loan features, eligibility, required documentation, and how to apply for a short term loan can help borrowers make informed decisions. Whether you're salaried or self-employed, short term loans offer convenience and speed. This guide walks you through the essentials so you can secure the right loan at the right time.
Pests of Rice: Damage, Identification, Life history, and Management.pptxArshad Shaikh
Rice pests can significantly impact crop yield and quality. Major pests include the brown plant hopper (Nilaparvata lugens), which transmits viruses like rice ragged stunt and grassy stunt; the yellow stem borer (Scirpophaga incertulas), whose larvae bore into stems causing deadhearts and whiteheads; and leaf folders (Cnaphalocrocis medinalis), which feed on leaves reducing photosynthetic area. Other pests include rice weevils (Sitophilus oryzae) and gall midges (Orseolia oryzae). Effective management strategies are crucial to minimize losses.
RE-LIVE THE EUPHORIA!!!!
The Quiz club of PSGCAS brings to you a fun-filled breezy general quiz set from numismatics to sports to pop culture.
Re-live the Euphoria!!!
QM: Eiraiezhil R K,
BA Economics (2022-25),
The Quiz club of PSGCAS
How to Create a Stage or a Pipeline in Odoo 18 CRMCeline George
In Odoo, the CRM (Customer Relationship Management) module’s pipeline is a visual representation of a company's sales process that helps sales teams track and manage their interactions with potential customers.
How to Create Time Off Request in Odoo 18 Time OffCeline George
Odoo 18 provides an efficient way to manage employee leave through the Time Off module. Employees can easily submit requests, and managers can approve or reject them based on company policies.
Different pricelists for different shops in odoo Point of Sale in Odoo 17Celine George
Price lists are a useful tool for managing the costs of your goods and services. This can assist you in working with other businesses effectively and maximizing your revenues. Additionally, you can provide your customers discounts by using price lists.
Analysis of Quantitative Data Parametric and non-parametric tests.pptxShrutidhara2
This presentation covers the following points--
Parametric Tests
• Testing the Significance of the Difference between Means
• Analysis of Variance (ANOVA) - One way and Two way
• Analysis of Co-variance (One-way)
Non-Parametric Tests:
• Chi-Square test
• Sign test
• Median test
• Sum of Rank test
• Mann-Whitney U-test
Moreover, it includes a comparison of parametric and non-parametric tests, a comparison of one-way ANOVA, two-way ANOVA, and one-way ANCOVA.
This presentation was provided by Nicole 'Nici" Pfeiffer of the Center for Open Science (COS), during the first session of our 2025 NISO training series "Secrets to Changing Behavior in Scholarly Communications." Session One was held June 5, 2025.
IDSP is a disease surveillance program in India that aims to strengthen/maintain decentralized laboratory-based IT enabled disease surveillance systems for epidemic prone diseases to monitor disease trends, and to detect and respond to outbreaks in the early phases swiftly.....
1. UNIT-II INHERITANCES,PACKAGES AND INTERFACE
Overloading Methods – Objects as Parameters – Returning Objects
–Static, Nested and Inner Classes. Inheritance: Basics– Types of
Inheritance -Super keyword -Method Overriding – Dynamic Method
Dispatch –Abstract Classes – final with Inheritance. Packages and
Interfaces: Packages – Packages and Member Access –Importing
Packages – Interfaces.
2. Overloading Methods
Method Overloading is a feature in Java that allows a class to have
more than one methods having same name, but with different
signatures (Parameters).
(Each method must have different number of parameters or
parameters having different types and orders).
3. Three ways to overload a method
1. Number of parameters. (Different number of parameters in argument list)
• For example: This is a valid case of overloading
• add(int, int)
• add(int, int, int)
2. Data type of parameters. (Difference in data type of parameters)
• For example:
• add(int, int)
• add(int, float)
4. 3. Sequence of Data type of parameters.
• For example:
• add(int, float)
• add(float, int)
9. Method Overloading with Type
Promotion:
• The name Type Promotion specifies that a small size
datatype can be promoted to a large size datatype. i.e., an
Integer data type can be promoted to long, float, double, etc.
• This Automatic Type Promotion is done when any method
which accepts a higher size data type argument is called with
the smaller data type.
16. STATIC, NESTED & INNER CLASSES
• An inner class is a class that is defined inside another class.
SYNTAX: FOR DECLARING INNER CLASSES
[modifier] class OuterClassName
{
---- Code -----
[modifier] class InnerClassName
{
---- Code ----
}
}
17. It is possible to define a class within another class; such classes are known as
nested classes.
if class B is defined within class A, then B does not exist independently of A.
There are two types of nested classes: static and non-static.
Static nested class is one that has the static modifier applied.
Because it is static, it must access the non-static members of its enclosing class
through an object.
That is, it cannot refer to non-static members of its enclosing class directly.
The most important type of nested class is the inner class.
An inner class is a non-static nested class.
It has access to all of the variables and methods of its outer class and may
refer to them directly in the same way that other non-static members of the
outer class do.
19. Access Outer Class From Inner Class
• We can access attributes and methods of the
inner class.
20. Static Inner Class
• Inner class also be a static class,which means when you
access it without creating an objects for inner class.
22. Inheritance
• Inheritance is a process of deriving a new class from existing class, also
called as “extending a class”.
• The class whose property is being inherited by another class is called
“base class” (or) “parent class” (or) “super class”.
• The class that inherits a particular property or a set of properties from
the base class is called “derived class” (or) “child class” (or) “sub class”.
24. • ADVANTAGES OF INHERITANCE:
• Reusability of Code:
• Inheritance is mainly used for code reusability (Code reusability means
that we can add extra features to an existing class without modifying it).
• Effort and Time Saving:
• The advantage of reusability saves the programmer time and effort. Since
the main code written can be reused in various situations as needed.
• Increased Reliability:
• The program with inheritance becomes more understandable and easily
maintainable as the sub classes are created from the existing reliably
working classes.
25. “extends” KEYWORD:
• Inheriting a class means creating a new class as an extension of another
class.
• The extends keyword is used to inherit a class from existing class.
• The general form of a class declaration that inherits a superclass is shown
here:
• Syntax:
26. Characteristics of Class Inheritance:
1. A class cannot be inherited from more than one base
class. Java does not support multiple inheritance
2. Sub class can access only the non-private members
of the super class.
3. Private data members of a super class are local only
to that class. Therefore, they can’t be accessed outside
the super class, even sub classes can’t access the private
members.
4. Protected features in Java are visible to all subclasses
as well as all other classes in the same package.
35. TYPES OF INHERITACE:
1. Single Inheritance
2. Multilevel Inheritance
3. Multiple Inheritance
4. Hierarchical Inheritance
5. Hybrid Inheritance
38. SINGLE INHERITANCE
• The process of creating only one subclass from
only one super class is known as Single
Inheritance.
• Only two classes are involved in this inheritance.
• The subclass can access all the members of
super class.
40. MULTILEVEL INHERITANCE
• The process of creating a new sub class from an already
inherited sub class is known as Multilevel Inheritance.
• Multiple classes are involved in inheritance, but one
class extends only one.
• The lowermost subclass can make use of all its super
classes' members.
• Multilevel inheritance is an indirect way of
implementing multiple inheritance.
45. Hybrid Inheritance
• In Hierarchical Inheritance, one class serves as a superclass
(base class) for more than one subclass.
• Class A serves as a base class for the derived classes B, C, and D.
48. Super keyword
• Super keyword is refer to the super class(parent class) object.
• It is used to call superclass methods, and to access the superclass
constructor.
• The super keyword is used to access the parent class object and is
based on the concept of inheritance in Java.
• The most common use of the super keyword is to eliminate the
confusion between superclasses and subclasses that have methods
with same name.
• super keyword is used for the following three purposes:
1. To invoke superclass constructor.
2. To invoke superclass members variables.
3. To invoke superclass methods.
53. Method overriding
• If subclass (child class) has the same method as
declared in the parent class, it is known as method
overriding in Java.
• Rules for Java Method Overriding
1. The method must have the same name as in the
parent class
2. The method must have the same parameter as in
the parent class.
3. There must be an (inheritance).
62. Dynamic method dispatch
• Dynamic method dispatch is the mechanism
by which a call to an overridden method is
resolved at run time, rather than compile time.
• Dynamic method dispatch is important
because this is how Java implements run-time
polymorphism
67. ABSTRACT CLASSES
• Abstraction is a process of hiding the
implementation details and showing only the
essential features to the user.
• For example: sending sms, you just type the text
and send the message. You don't know the
internal processing about the message delivery.
68. • Keyword for abstract-”abstract”
• It contains
Abstract class-(a class contains atleast one abstract
method).
Abstract method(methods having only declaration inside
the class)-definition will be in derived class.
Concrete class/method-(class which doesn’t contain any
abstract method/class)
• We can’t create object for abstract class.
70. Rules for abstract class
• An abstract class must be declared with an abstract
keyword.
• It can have abstract and non-abstract methods.
• It cannot be instantiated i.e.,object of such class cannot be
created directly using new keyword. .
• It can have constructors and static methods also.
• It can have final methods which will force the subclass not to
change the body of the method.
73. Rules for Abstract Methods
• The abstract keyword is also used to declare a
method as abstract.
• An abstract method consists of a parameters, but
no method body.
• Abstract method would have no definition, and its
parameters is followed by a semicolon, not curly
braces
74. Example for abstract class
abstract class shape
{
int x,y; //member declaration
void draw() //concrete method
{
System.out.println(“draw”);
}
abstract void draw(); //abstract method
}
79. FINAL WITH INHERITANCE
• Final is a keyword or reserved word in java used for restricting some
functionality.
• It can be applied to member variables, methods, class and local
variables in Java.
• final keyword has three uses:
1. For declaring variable – to create a named constant. A final
variable cannot be changed once it is initialized.
2. For declaring the methods – to prevent method overriding. A
final method cannot be overridden by subclasses.
3. For declaring the class – to prevent a class from inheritance. A
final class cannot be inherited.
80. 1. Final Variable:
• Any variable either member variable or local
variable (declared inside method) modified by final
keyword is called final variable.
• Syntax:
81. • The final variable can be assigned only once.
• The value of the final variable will not be changed during the
execution of the program.
• If an attempt is made to alter the final variable value, the
java compiler will throw an error message.
82. • There is a final variable speedlimit, we are going to change the value of
this variable, but It can't be changed because final variable once
assigned a value can never be changed.
83. 2. Final Methods:
• Final keyword in java can also be applied to methods.
• A java method with final keyword is called final method and it cannot
be overridden in sub-class.
• If a method is defined with final keyword, it cannot be overridden in the
subclass and its behaviour should remain constant in sub-classes.
85. 3. Final Classes:
• Java class with final modifier is called final class in Java and they cannot
be sub-classed or inherited.
87. Points to Remember
1) A constructor cannot be declared as final
2) We cannot change the value of a final variable.
3) A final method cannot be overridden.
4) A final class cannot be inherited.
5) If method parameters are declared final then the value of
these parameters cannot be changed.
88. PACKAGES
• A Package can be defined as a collection of classes,
interfaces, enumerations providing access protection and
name space management.
Package can be categorized in two form:
1. Built-in package
2. user-defined package.
90. CREATING USER DEFINED PACKAGES:
• Java package created by user to categorize their project's
classes and interface are known as user-defined packages.
• When creating a package, you should choose a name for the
package.
• Put a package statement with that name at the top of every
source file that contains the classes and interfaces.
• The package statement should be the first line in the source
file.
• There can be only one package statement in each source file
91. Steps involved in creating user-defined package:
• Include package statement along with the
package name as the first statement in the
program.
• Write class declarations.
• Save the file in this directory as “name of
class.java”.
• Compile this file using java compiler.
93. To create the above package,
1. Create a directory called pack.
2. Open a new file and enter the code given
above.
3. Save the file as class1.java in the directory.
4. A package called pack has now been created
which contains one class class1.
97. ACCESSING A PACKAGE (using “import” keyword):
• The import keyword is used to make the classes and interface
of another package accessible to the current package.
98. • There are three ways to access the package
from outside the package.
1. import package.*;
2. import package.classname;
3. fully qualified name.
99. Using packagename.*
• If you use package.* then all the classes and interfaces of this
package will be accessible but not subpackages.
Using packagename.classname
• If you import package.classname then only declared class of this
package will be accessible.
Using fully qualified name
• If you use fully qualified name then only declared class of this
package will be accessible.
• Now there is no need to import. But you need to use fully qualified
name every time when you are accessing the class or interface.
103. PACKAGES AND MEMBER ACCESS
• Access level modifiers determine whether
other classes can use a particular field or
invoke a particular method.
• There are two levels of access control:
• At the top level— public, or package-private
At the member level—public, private,
protected, or package-private
104. Top Level access control:
• A class may be declared with the modifier public, in
which case that class is visible to all classes
everywhere.
• If a class has no modifier (the default, also known
as package-private), it is visible only within its own
package.
105. Member Level access control:
• public – if a member is declared with public, it is visible
and accessible to all classes everywhere.
• private - The private modifier specifies that the member
can only be accessed in its own class.
• protected - The protected modifier specifies that the
member can only be accessed within its own package
and, in addition, by a subclass of its class in another
package.
110. INTERFACES
• “interface” is a keyword which is used to achieve full
abstraction. Using interface, we can specify what the class
must do but not how it does.
• An interface is a collection of method definitions (without
implementations) and constant values.
• It is a blueprint of a class.
• It has static constants and abstract methods.
111. • An interface is similar to a class in the following
ways:
• An interface can contain any number of methods.
• An interface is written in a file with a .java
extension, with the name of the interface matching
the name of the file.
• The bytecode of an interface appears in a .class file.
115. Where,
• Access_specifer : either public or none.
• Name: name of an interface can be any valid java identifier.
• Variables: They are implicitly public, final and static,
meaning that they cannot be changed by the implementing
class. They must be initialized with a constant value.
• Methods: They are implicitly public and abstract, meaning
that they must be declared without body and defined only by
the implementing class.
118. Implementing Interfaces (“implements” keyword):
• Once an interface has been defined, one or
more classes can implement that interface.
• A class uses the implements keyword to
implement an interface.
• The implements keyword appears in the class
declaration following the extends portion of
the declaration.
125. Nested Interfaces
• An interface can be declared a member of a
class or another interface.
• Such an interface is called a member interface
or a nested interface.
• A nested interface can be declared as public,
private, or protected.