Object Oriented Programming_Lecture 3
Let’s think on fields of class
Visibility Modifiers and Accessor Methods
الكلية الجامعية للعلوم والتكنولوجيا - خان يونس
University college of science & technology
chapter 1: Lecture 2
Let’s think on concept of Class and Object
- Concept of Objects and classes
- UML Class Diagram
الكلية الجامعية للعلوم والتكنولوجيا - خان يونس
University college of science & technology
ملفات مساق البرمجة الهدفية (الشيئية) التي يتم تدريسها لطلبة بكالوريوس تكنولوجيا المعلومات وبكالوريوس تطوير نظم الحاسوب في الكلية الجامعية للعلوم والتكنولوجيا.
الملف يضم مفاهيم:
Class
Object
إعدادي وتدريسي
Object Oriented Programming_Chapter 4 (Two Lectures)
1- Let’s think on polymorphism
2- Let’s focus on Full Example
الكلية الجامعية للعلوم والتكنولوجيا - خان يونس
University college of science & technology
Object Oriented Programming_Chapter 3 (Two Lectures)
1- Let’s think on Inheritance
2- Let’s focus on Superclass’s Constructor
الكلية الجامعية للعلوم والتكنولوجيا - خان يونس
University college of science & technology
ملفات مساق البرمجة الهدفية (الشيئية) التي يتم تدريسها لطلبة بكالوريوس تكنولوجيا المعلومات وبكالوريوس تطوير نظم الحاسوب في الكلية الجامعية للعلوم والتكنولوجيا.
الملف يضم مفهوم الوراثة Polymorphism
إعدادي وتدريسي
This document discusses arrays of objects in object-oriented programming. It outlines that a class can be used as a new data type, and arrays can be defined to hold multiple objects of that class. Methods can be used to manage arrays of objects, such as adding, deleting, and searching for objects. The document also explains that objects are passed by reference to methods rather than by value. An immutable class is defined as one that does not allow changes to its private data fields once an object is created. The document provides a full example of a contact book program that uses a Contact class and ManagArray class to store contact objects in an array and perform operations on them.
ملفات مساق البرمجة الهدفية (الشيئية) التي يتم تدريسها لطلبة بكالوريوس تكنولوجيا المعلومات وبكالوريوس تطوير نظم الحاسوب في الكلية الجامعية للعلوم والتكنولوجيا.
الملف يضم مفهوم الوراثة Inheritance
إعدادي وتدريسي
ملفات مساق البرمجة الهدفية (الشيئية) التي يتم تدريسها لطلبة بكالوريوس تكنولوجيا المعلومات وبكالوريوس تطوير نظم الحاسوب في الكلية الجامعية للعلوم والتكنولوجيا.
الملف يضم مفهوم مصفوفة الكائنات Array of Objects
إعدادي وتدريسي
The document summarizes a workshop on object-oriented programming (OOP) polymorphism in Java. It discusses the four principles of OOP - encapsulation, abstraction, inheritance, and polymorphism. It provides examples of implementing interfaces and abstract classes, and how classes can extend other classes and implement multiple interfaces. The key concepts are programming to interfaces rather than implementations for flexibility, and that interfaces allow implementing multiple interfaces while classes only allow single inheritance.
This slide is based on Object Oriented Programming Language. Here is some details about object and class. You can easily understand about object and class.
The document discusses class and object-oriented programming (OOP) concepts in C++. It explains that OOP uses classes and objects, and defines key characteristics like abstraction, encapsulation, inheritance, and polymorphism. A class is a blueprint that defines variables and functions, while an object is an instance of a class in memory. The document provides examples of defining a class with private and public members, as well as creating and accessing objects. It also describes access specifiers like private, public, and protected that control member accessibility.
This document discusses object-oriented programming concepts in Java including objects, classes, constructors, inheritance, polymorphism, and access modifiers.
The key points are:
1) An object represents an entity with a unique identity, state, and behaviors. A class defines common properties and behaviors of objects.
2) Constructors initialize new objects, while methods define object behaviors. Inheritance allows subclasses to inherit properties and behaviors from parent classes.
3) Access modifiers like public, private, and protected control the visibility and accessibility of classes, variables, and methods. Final and abstract modifiers are also used to restrict or require subclassing.
This document introduces classes and objects in Java. It defines a class as a collection of fields and methods that operate on those fields. It shows how to define a Circle class with fields for the x and y coordinates and radius, and methods to calculate the circumference and area. It demonstrates how to create Circle objects, access the object fields and methods, and use the Circle class in a sample program.
This document discusses classes and objects in C++. It defines a class as a user-defined data type that implements an abstract object by combining data members and member functions. Data members are called data fields and member functions are called methods. An abstract data type separates logical properties from implementation details and supports data abstraction, encapsulation, and hiding. Common examples of abstract data types include Boolean, integer, array, stack, queue, and tree structures. The document goes on to describe class definitions, access specifiers, static members, and how to define and access class members and methods.
Java classes and objects are fundamental concepts in object-oriented programming. A class defines the attributes and behaviors of a type of object, acting as a blueprint. An object is an instance of a class, having state stored in fields and behavior through methods. The document provides examples of defining a Dog class with name, breed and color attributes, along with behaviors like barking. It also demonstrates creating Puppy objects, setting fields, and calling methods. Constructors initialize new objects, and classes can contain variables, methods and constructors.
This document discusses classes, objects, and methods in Java. It defines a class as a user-defined data type that contains fields and methods. Objects are instances of classes that allocate memory at runtime. Methods define behaviors for objects and are declared within classes. The document covers defining classes, creating objects, accessing members, constructors, method overloading and overriding, static members, passing objects as parameters, recursion, and visibility control.
Method overloading, recursion, passing and returning objects from method, new...JAINAM KAPADIYA
This document discusses method overloading, recursion, and passing and returning objects from methods in Java. It provides examples of using the new operator to dynamically allocate memory for objects, a recursive method to calculate a factorial, passing an object as an argument to a method to check equality, and returning a new object from a method that increments a field.
This document provides an overview of object-oriented programming (OOP) concepts in Java. It defines OOP as a style of programming that focuses on using objects to design and build applications. It describes what objects are, how they model real-world things, and how they use variables to store state and methods to define behavior. It then defines key OOP concepts like classes, objects, abstraction, encapsulation, polymorphism, method overriding, inheritance, and interfaces. For each concept, it provides a definition and example in Java code. The document is intended to help the reader learn more about these fundamental OOP concepts in Java.
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
The lecture was condcuted by Tushar B Kute at YCMOU, Nashik through VLC orgnanized by MSBTE. The contents can be found in book "Core Java Programming - A Practical Approach' by Laxmi Publications.
The document discusses classes and objects in .NET. It defines classes as templates that define an object's properties and behaviors. Objects are instances of classes that have state defined by their property values. The document provides examples of declaring classes and objects in C#, and discusses accessing fields, properties, methods, and constructors of classes and objects. It also covers the differences between instance and static members of classes.
oops concept in java | object oriented programming in javaCPD INDIA
The document discusses key concepts in object-oriented programming in Java including classes, objects, inheritance, packages, interfaces, encapsulation, abstraction, and polymorphism. It provides examples to illustrate each concept. Classes define the structure and behavior of objects. Objects are instances of classes. Inheritance allows classes to extend existing classes. Packages organize related classes. Interfaces define behaviors without implementation. Encapsulation hides implementation details. Abstraction models essential features without specifics. Polymorphism allows the same method name with different signatures or overriding.
This document discusses data members and member functions in object-oriented programming. It defines data members as variables declared inside a class and member functions as functions declared inside a class. It covers accessing public, private, and protected data members, defining member functions inside and outside the class, and different types of member functions like static, const, inline, and friend functions. The document provides examples and explanations for each concept to help explain how data members and member functions work in object-oriented programming.
This document discusses various types of methods in Java, including instance methods, static methods, methods with and without parameters and return values, and method overloading and overriding. Instance methods require an object to be called and belong to that object, while static methods can be called without an object and belong to the class. Method overloading allows methods with the same name but different parameters, and overriding allows subclasses to provide their own implementation of a method from the parent class.
A class is a blueprint that defines the data and functions of objects created from it. Constructors are special functions that are executed when an object is created from a class to initialize the object's data. Constructors can be overloaded, do not have a return type, and can only assign variables within the class.
The static keyword in Java is used for memory management. It allows variables and methods to belong to the class rather than instances of the class. Static variables and methods are associated with the class, not objects, so they can be accessed without creating an object of the class. Static variables only have one copy in memory and static methods can access static variables and change their values without creating an object. Examples demonstrate how to declare static variables and methods and how they differ from non-static variables and methods.
This document summarizes a lecture on object-oriented programming concepts including classes, methods, constructors, and objects.
The lecture covered:
1) The components of a class including fields, methods, and constructors. Main(), setter, and getter methods were discussed.
2) How to call methods within the same class and between different classes.
3) How to create objects from classes and how messages are sent to objects to invoke their methods.
This document discusses object-oriented programming concepts in Java such as classes, objects, inheritance, encapsulation, and polymorphism. It provides examples of defining classes with variables, methods, and constructors. It also covers creating and initializing objects, accessing instance variables and methods, and the different ways to create objects like using the new keyword, factory methods, and anonymous objects. The document also discusses strings, arrays, and core Java class libraries.
The document summarizes a workshop on object-oriented programming (OOP) polymorphism in Java. It discusses the four principles of OOP - encapsulation, abstraction, inheritance, and polymorphism. It provides examples of implementing interfaces and abstract classes, and how classes can extend other classes and implement multiple interfaces. The key concepts are programming to interfaces rather than implementations for flexibility, and that interfaces allow implementing multiple interfaces while classes only allow single inheritance.
This slide is based on Object Oriented Programming Language. Here is some details about object and class. You can easily understand about object and class.
The document discusses class and object-oriented programming (OOP) concepts in C++. It explains that OOP uses classes and objects, and defines key characteristics like abstraction, encapsulation, inheritance, and polymorphism. A class is a blueprint that defines variables and functions, while an object is an instance of a class in memory. The document provides examples of defining a class with private and public members, as well as creating and accessing objects. It also describes access specifiers like private, public, and protected that control member accessibility.
This document discusses object-oriented programming concepts in Java including objects, classes, constructors, inheritance, polymorphism, and access modifiers.
The key points are:
1) An object represents an entity with a unique identity, state, and behaviors. A class defines common properties and behaviors of objects.
2) Constructors initialize new objects, while methods define object behaviors. Inheritance allows subclasses to inherit properties and behaviors from parent classes.
3) Access modifiers like public, private, and protected control the visibility and accessibility of classes, variables, and methods. Final and abstract modifiers are also used to restrict or require subclassing.
This document introduces classes and objects in Java. It defines a class as a collection of fields and methods that operate on those fields. It shows how to define a Circle class with fields for the x and y coordinates and radius, and methods to calculate the circumference and area. It demonstrates how to create Circle objects, access the object fields and methods, and use the Circle class in a sample program.
This document discusses classes and objects in C++. It defines a class as a user-defined data type that implements an abstract object by combining data members and member functions. Data members are called data fields and member functions are called methods. An abstract data type separates logical properties from implementation details and supports data abstraction, encapsulation, and hiding. Common examples of abstract data types include Boolean, integer, array, stack, queue, and tree structures. The document goes on to describe class definitions, access specifiers, static members, and how to define and access class members and methods.
Java classes and objects are fundamental concepts in object-oriented programming. A class defines the attributes and behaviors of a type of object, acting as a blueprint. An object is an instance of a class, having state stored in fields and behavior through methods. The document provides examples of defining a Dog class with name, breed and color attributes, along with behaviors like barking. It also demonstrates creating Puppy objects, setting fields, and calling methods. Constructors initialize new objects, and classes can contain variables, methods and constructors.
This document discusses classes, objects, and methods in Java. It defines a class as a user-defined data type that contains fields and methods. Objects are instances of classes that allocate memory at runtime. Methods define behaviors for objects and are declared within classes. The document covers defining classes, creating objects, accessing members, constructors, method overloading and overriding, static members, passing objects as parameters, recursion, and visibility control.
Method overloading, recursion, passing and returning objects from method, new...JAINAM KAPADIYA
This document discusses method overloading, recursion, and passing and returning objects from methods in Java. It provides examples of using the new operator to dynamically allocate memory for objects, a recursive method to calculate a factorial, passing an object as an argument to a method to check equality, and returning a new object from a method that increments a field.
This document provides an overview of object-oriented programming (OOP) concepts in Java. It defines OOP as a style of programming that focuses on using objects to design and build applications. It describes what objects are, how they model real-world things, and how they use variables to store state and methods to define behavior. It then defines key OOP concepts like classes, objects, abstraction, encapsulation, polymorphism, method overriding, inheritance, and interfaces. For each concept, it provides a definition and example in Java code. The document is intended to help the reader learn more about these fundamental OOP concepts in Java.
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
The lecture was condcuted by Tushar B Kute at YCMOU, Nashik through VLC orgnanized by MSBTE. The contents can be found in book "Core Java Programming - A Practical Approach' by Laxmi Publications.
The document discusses classes and objects in .NET. It defines classes as templates that define an object's properties and behaviors. Objects are instances of classes that have state defined by their property values. The document provides examples of declaring classes and objects in C#, and discusses accessing fields, properties, methods, and constructors of classes and objects. It also covers the differences between instance and static members of classes.
oops concept in java | object oriented programming in javaCPD INDIA
The document discusses key concepts in object-oriented programming in Java including classes, objects, inheritance, packages, interfaces, encapsulation, abstraction, and polymorphism. It provides examples to illustrate each concept. Classes define the structure and behavior of objects. Objects are instances of classes. Inheritance allows classes to extend existing classes. Packages organize related classes. Interfaces define behaviors without implementation. Encapsulation hides implementation details. Abstraction models essential features without specifics. Polymorphism allows the same method name with different signatures or overriding.
This document discusses data members and member functions in object-oriented programming. It defines data members as variables declared inside a class and member functions as functions declared inside a class. It covers accessing public, private, and protected data members, defining member functions inside and outside the class, and different types of member functions like static, const, inline, and friend functions. The document provides examples and explanations for each concept to help explain how data members and member functions work in object-oriented programming.
This document discusses various types of methods in Java, including instance methods, static methods, methods with and without parameters and return values, and method overloading and overriding. Instance methods require an object to be called and belong to that object, while static methods can be called without an object and belong to the class. Method overloading allows methods with the same name but different parameters, and overriding allows subclasses to provide their own implementation of a method from the parent class.
A class is a blueprint that defines the data and functions of objects created from it. Constructors are special functions that are executed when an object is created from a class to initialize the object's data. Constructors can be overloaded, do not have a return type, and can only assign variables within the class.
The static keyword in Java is used for memory management. It allows variables and methods to belong to the class rather than instances of the class. Static variables and methods are associated with the class, not objects, so they can be accessed without creating an object of the class. Static variables only have one copy in memory and static methods can access static variables and change their values without creating an object. Examples demonstrate how to declare static variables and methods and how they differ from non-static variables and methods.
This document summarizes a lecture on object-oriented programming concepts including classes, methods, constructors, and objects.
The lecture covered:
1) The components of a class including fields, methods, and constructors. Main(), setter, and getter methods were discussed.
2) How to call methods within the same class and between different classes.
3) How to create objects from classes and how messages are sent to objects to invoke their methods.
This document discusses object-oriented programming concepts in Java such as classes, objects, inheritance, encapsulation, and polymorphism. It provides examples of defining classes with variables, methods, and constructors. It also covers creating and initializing objects, accessing instance variables and methods, and the different ways to create objects like using the new keyword, factory methods, and anonymous objects. The document also discusses strings, arrays, and core Java class libraries.
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 discusses objects and classes in Java. It begins by defining what a class is - a template that defines common properties of objects. Everything in a Java program must be encapsulated within a class. A class defines an object's state via fields and behavior via methods. The document then discusses how to define classes by specifying fields, methods, and constructors. It provides examples of creating objects from classes and accessing object members. The document also covers key object-oriented programming concepts like encapsulation and inheritance.
Java As an OOP Language,Exception Handling & AppletsHelen SagayaRaj
Java classes can define instance variables, class variables, methods, and constructors. Instance variables are declared within a class but outside methods and are unique to each object. Class variables are declared with the static keyword and are shared among all objects of a class. Constructors initialize new objects and have the same name as the class without a return type. Inheritance allows a subclass to extend a superclass, overriding methods and using the super constructor. Finalizer methods cleanup objects before garbage collection.
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...Sagar Verma
OOPS and its application in Java, Super class AND This Keyword,Java Bean, POJO ,Memory management in Java ,Packages ,Miscellaneous (Var-Args, toString(), Double equals operator(==))
Polymorphism allows methods to be used generically for a wide range of object arguments, known as generic programming. When a method takes a superclass as a parameter, any subclass of that parameter can be passed to the method. At runtime, the specific implementation of the method invoked is determined dynamically based on the actual object passed. This capability is known as dynamic binding. Casting may be needed when assigning an object to a variable of a superclass or subclass in the inheritance hierarchy.
The document provides an overview of object-oriented programming concepts in .NET such as classes, objects, methods, constructors, destructors, inheritance, polymorphism, interfaces, access modifiers, and static members. It defines each concept and provides examples to illustrate how they are implemented in C#.
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.
Java tutorial for Beginners and Entry LevelRamrao Desai
This document provides an overview of key Java concepts including classes, objects, inheritance, interfaces, exceptions, and more. It begins with a roadmap and definitions of object-oriented concepts like class and object. It then covers class variables and methods, visibility, static vs non-static, constructors, and the this keyword. The document also discusses inheritance, polymorphism, interfaces, exceptions, and error handling in Java.
The document discusses key concepts in object-oriented programming in Java including classes, objects, methods, constructors, and inheritance. Specifically, it explains that in Java, classes define the structure and behavior of objects through fields and methods. Objects are instances of classes that allocate memory at runtime. Methods define the behaviors of objects, and constructors initialize objects during instantiation. Inheritance allows classes to extend the functionality of other classes.
This document provides an overview of object-oriented programming concepts in Java including two programming paradigms, OOP principles like encapsulation, polymorphism, abstraction and inheritance. It discusses classes, objects, and reference variables in Java. Key points covered are how classes act as blueprints for objects, the difference between objects and reference variables, and how methods can be called on objects.
Class is a blueprint that defines the properties and behaviors that objects of that class will have. It represents the state and behavior of specific objects. Constructors are special methods used to initialize objects, and are called when an object is created. Methods define the behaviors of objects and can be user-defined or predefined. The garbage collector automatically reclaims unused memory by destroying unused objects.
1. A class is a blueprint for objects that defines common properties and methods. It can include modifiers, name, superclass/interfaces, and a class body.
2. An object is created using the new keyword, assigning the object to a reference variable. Reference variables store an object's address in memory. Assigning one reference variable to another does not create distinct copies but points to the same object.
3. A method performs a specific task and can return a result. It includes modifiers, return type, name, parameters, and a method body. Method overloading allows methods with the same name but different parameters.
Class is a blueprint for creating objects that share common attributes and behaviors. A class defines the data and methods that describe the object. Classes in Java can contain data members, methods, constructors, nested classes, and interfaces. Objects are instances of classes that occupy memory at runtime and can access class members like variables and methods. Constructors initialize an object when it is created and have the same name as the class. The this keyword refers to the current object in a method or constructor. Command line arguments can be passed to a program as strings and accessed via the args parameter in the main method.
This document discusses basic object-oriented programming concepts in Java, including classes, objects, instance variables, methods, constructors, and the "this" keyword. It provides examples of defining a Ship class with fields like location and speed, and methods like move() and printLocation(). Constructors are used to initialize new Ship objects, and the "this" keyword differentiates instance variables from local variables within methods.
This document discusses repetition statements in Java, including while, for, and do-while loops. It provides examples of using each loop type, such as calculating the average of test grades in a class and summing even integers. The break and continue statements are also covered, along with examples of how they alter loop flow. Key aspects of counter-controlled repetition like loop counters, initialization, increment/decrement, and continuation conditions are defined.
This document provides an outline and overview of hashing and hash tables. It defines hashing as a technique for storing data to allow for fast insertion, retrieval, and deletion. A hash table uses an array and hash function to map keys to array indices. Collision resolution techniques like linear probing are discussed. The document also summarizes the Hashtable class in .NET, which uses buckets and load factor to avoid collisions. Examples of hash functions and using the Hashtable class are provided.
This document discusses graphs and their representation in code. It defines graphs as consisting of vertices and edges, with edges specified as pairs of vertices. It distinguishes between directed and undirected graphs. Key graph terms like paths, cycles, and connectivity are defined. Real-world systems that can be modeled as graphs are given as an example. The document then discusses representing vertices and edges in code, choosing an adjacency matrix to represent the edges in the graph.
The document discusses trees and binary trees as data structures. It defines what a tree is, including parts like the root, parent, child, leaf nodes. It then defines binary trees as trees where each node has no more than two children. Binary search trees are introduced as binary trees where all left descendants of a node are less than or equal to the node and all right descendants are greater. The document concludes by discussing how to build a binary search tree class with Node objects.
This document provides an outline and overview of the queue data structure. It defines a queue as a first-in, first-out (FIFO) structure where new items are added to the rear of the queue and items are removed from the front. The key queue operations of enqueue and dequeue are described. Code examples are provided for implementing a queue using a linked list structure with classes for the queue, its nodes, and methods for common queue operations like enqueue, dequeue, peek, clear, print, and search. Different types of queues like linear, circular, and double-ended queues are also mentioned.
The document provides an overview of stack data structures, including definitions and examples. It discusses key stack operations like push, pop, peek, clear, print all, and search. Code examples are given for an Employee class and Stack class implementation to demonstrate how these operations work on a stack of employee objects. The document aims to teach the fundamentals of stack data structures and provide code samples to practice stack operations.
This document provides an outline and overview of linked lists. It defines a linked list as a collection of nodes that are linked together by references to the next node. Each node contains a data field and a reference field. It describes how to implement a linked list using a self-referential class with fields for data and a reference to the next node. It then outlines common linked list operations like insertion and deletion at different positions as well as sorting and searching the linked list.
Chapter 4: basic search algorithms data structureMahmoud Alfarra
1) The document discusses two common search algorithms: sequential search and binary search. Sequential search looks at each item in a list sequentially until the target is found. Binary search works on a sorted list and divides the search space in half at each step.
2) It provides pseudocode examples of how each algorithm works step-by-step to find a target value in a list or array.
3) Binary search is more efficient than sequential search when the list is sorted, as it can significantly reduce the number of comparisons needed to find the target. Sequential search is used when the list is unsorted.
Chapter 3: basic sorting algorithms data structureMahmoud Alfarra
The document provides an outline and introduction for a chapter on basic sorting algorithms, including bubble sort, selection sort, and insertion sort algorithms. It includes pseudocode examples and explanations of each algorithm. It notes that bubble sort is one of the slowest but simplest algorithms, involving values "floating" to their correct positions. Selection sort finds the smallest element and places it in the first position, then repeats to find the next smallest. Insertion sort works by moving larger elements to the right to make room for smaller elements inserted from the left.
This document is a presentation on data structures in C# by Mr. Mahmoud R. Alfarra. It introduces C# and its uses in different applications. It covers various data types in C#, calculations and logical operations, control statements like if/else and loops. The document also discusses arrays, methods, and classes in C#. It provides examples to explain concepts like selection statements, iteration, and calling methods. The presentation aims to provide an introduction to the principles of C# for learning purposes.
This document provides an introduction and outline for a course on data structures. It introduces the lecturer, Mahmoud Rafeek Alfarra, and lists his qualifications. It outlines the course objectives, resources, guidelines, assessment, and schedule. Key topics that will be covered include arrays, sorting and searching algorithms, linked lists, stacks, queues, trees and graphs. The document provides classifications of different types of data structures such as linear vs nonlinear, static vs dynamic memory allocation. It concludes with information about how students can be successful in the course.
Definition of classification
Basic principles of classification
Typical
How Does Classification Works?
Difference between Classification & Prediction.
Machine learning techniques
Decision Trees
k-Nearest Neighbors
This document is a lecture on decision making practices in Java. It identifies errors in code snippets involving if/else statements and while loops. It also contains examples to trace code with variables and determine output based on variable values. The document is in Arabic and English and presented by Mahmoud R. Alfarra on using Java and correcting errors in code involving conditional and iterative structures.
This document discusses selection statements in Java including if-else statements, nested if-else statements, blocks, and switch statements. It provides examples of using these statements to check conditions, compare values, and select different code paths. It also assigns practice problems for students to write programs using selection statements to check grades, login credentials, and print days of the week.
This document provides an introduction to object-oriented programming concepts like classes, objects, and methods in Java. It defines classes as templates that define attributes and behaviors of objects as variables and methods. Objects are instances of classes. The document explains how to declare a class with access modifiers, variables, constructors, and methods. It also demonstrates how to create objects using the new keyword and access object attributes and methods.
What is a computer?
Computer Organization
Programming languages
Java Class Libraries
Typical Java development environment
Case Study: Unified Modeling Language
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetSritoma Majumder
Introduction
All the materials around us are made up of elements. These elements can be broadly divided into two major groups:
Metals
Non-Metals
Each group has its own unique physical and chemical properties. Let's understand them one by one.
Physical Properties
1. Appearance
Metals: Shiny (lustrous). Example: gold, silver, copper.
Non-metals: Dull appearance (except iodine, which is shiny).
2. Hardness
Metals: Generally hard. Example: iron.
Non-metals: Usually soft (except diamond, a form of carbon, which is very hard).
3. State
Metals: Mostly solids at room temperature (except mercury, which is a liquid).
Non-metals: Can be solids, liquids, or gases. Example: oxygen (gas), bromine (liquid), sulphur (solid).
4. Malleability
Metals: Can be hammered into thin sheets (malleable).
Non-metals: Not malleable. They break when hammered (brittle).
5. Ductility
Metals: Can be drawn into wires (ductile).
Non-metals: Not ductile.
6. Conductivity
Metals: Good conductors of heat and electricity.
Non-metals: Poor conductors (except graphite, which is a good conductor).
7. Sonorous Nature
Metals: Produce a ringing sound when struck.
Non-metals: Do not produce sound.
Chemical Properties
1. Reaction with Oxygen
Metals react with oxygen to form metal oxides.
These metal oxides are usually basic.
Non-metals react with oxygen to form non-metallic oxides.
These oxides are usually acidic.
2. Reaction with Water
Metals:
Some react vigorously (e.g., sodium).
Some react slowly (e.g., iron).
Some do not react at all (e.g., gold, silver).
Non-metals: Generally do not react with water.
3. Reaction with Acids
Metals react with acids to produce salt and hydrogen gas.
Non-metals: Do not react with acids.
4. Reaction with Bases
Some non-metals react with bases to form salts, but this is rare.
Metals generally do not react with bases directly (except amphoteric metals like aluminum and zinc).
Displacement Reaction
More reactive metals can displace less reactive metals from their salt solutions.
Uses of Metals
Iron: Making machines, tools, and buildings.
Aluminum: Used in aircraft, utensils.
Copper: Electrical wires.
Gold and Silver: Jewelry.
Zinc: Coating iron to prevent rusting (galvanization).
Uses of Non-Metals
Oxygen: Breathing.
Nitrogen: Fertilizers.
Chlorine: Water purification.
Carbon: Fuel (coal), steel-making (coke).
Iodine: Medicines.
Alloys
An alloy is a mixture of metals or a metal with a non-metal.
Alloys have improved properties like strength, resistance to rusting.
*Metamorphosis* is a biological process where an animal undergoes a dramatic transformation from a juvenile or larval stage to a adult stage, often involving significant changes in form and structure. This process is commonly seen in insects, amphibians, and some other animals.
Understanding P–N Junction Semiconductors: A Beginner’s GuideGS Virdi
Dive into the fundamentals of P–N junctions, the heart of every diode and semiconductor device. In this concise presentation, Dr. G.S. Virdi (Former Chief Scientist, CSIR-CEERI Pilani) covers:
What Is a P–N Junction? Learn how P-type and N-type materials join to create a diode.
Depletion Region & Biasing: See how forward and reverse bias shape the voltage–current behavior.
V–I Characteristics: Understand the curve that defines diode operation.
Real-World Uses: Discover common applications in rectifiers, signal clipping, and more.
Ideal for electronics students, hobbyists, and engineers seeking a clear, practical introduction to P–N junction semiconductors.
Odoo Inventory Rules and Routes v17 - Odoo SlidesCeline George
Odoo's inventory management system is highly flexible and powerful, allowing businesses to efficiently manage their stock operations through the use of Rules and Routes.
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingCeline George
The Accounting module in Odoo 17 is a complete tool designed to manage all financial aspects of a business. Odoo offers a comprehensive set of tools for generating financial and tax reports, which are crucial for managing a company's finances and ensuring compliance with tax regulations.
GDGLSPGCOER - Git and GitHub Workshop.pptxazeenhodekar
This presentation covers the fundamentals of Git and version control in a practical, beginner-friendly way. Learn key commands, the Git data model, commit workflows, and how to collaborate effectively using Git — all explained with visuals, examples, and relatable humor.
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...larencebapu132
This is short and accurate description of World war-1 (1914-18)
It can give you the perfect factual conceptual clarity on the great war
Regards Simanchala Sarab
Student of BABed(ITEP, Secondary stage)in History at Guru Nanak Dev University Amritsar Punjab 🙏🙏
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schoolsdogden2
Algebra 1 is often described as a “gateway” class, a pivotal moment that can shape the rest of a student’s K–12 education. Early access is key: successfully completing Algebra 1 in middle school allows students to complete advanced math and science coursework in high school, which research shows lead to higher wages and lower rates of unemployment in adulthood.
Learn how The Atlanta Public Schools is using their data to create a more equitable enrollment in middle school Algebra classes.
Link your Lead Opportunities into Spreadsheet using odoo CRMCeline George
In Odoo 17 CRM, linking leads and opportunities to a spreadsheet can be done by exporting data or using Odoo’s built-in spreadsheet integration. To export, navigate to the CRM app, filter and select the relevant records, and then export the data in formats like CSV or XLSX, which can be opened in external spreadsheet tools such as Excel or Google Sheets.
The Pala kings were people-protectors. In fact, Gopal was elected to the throne only to end Matsya Nyaya. Bhagalpur Abhiledh states that Dharmapala imposed only fair taxes on the people. Rampala abolished the unjust taxes imposed by Bhima. The Pala rulers were lovers of learning. Vikramshila University was established by Dharmapala. He opened 50 other learning centers. A famous Buddhist scholar named Haribhadra was to be present in his court. Devpala appointed another Buddhist scholar named Veerdeva as the vice president of Nalanda Vihar. Among other scholars of this period, Sandhyakar Nandi, Chakrapani Dutta and Vajradatta are especially famous. Sandhyakar Nandi wrote the famous poem of this period 'Ramcharit'.
This chapter provides an in-depth overview of the viscosity of macromolecules, an essential concept in biophysics and medical sciences, especially in understanding fluid behavior like blood flow in the human body.
Key concepts covered include:
✅ Definition and Types of Viscosity: Dynamic vs. Kinematic viscosity, cohesion, and adhesion.
⚙️ Methods of Measuring Viscosity:
Rotary Viscometer
Vibrational Viscometer
Falling Object Method
Capillary Viscometer
🌡️ Factors Affecting Viscosity: Temperature, composition, flow rate.
🩺 Clinical Relevance: Impact of blood viscosity in cardiovascular health.
🌊 Fluid Dynamics: Laminar vs. turbulent flow, Reynolds number.
🔬 Extension Techniques:
Chromatography (adsorption, partition, TLC, etc.)
Electrophoresis (protein/DNA separation)
Sedimentation and Centrifugation methods.
A measles outbreak originating in West Texas has been linked to confirmed cases in New Mexico, with additional cases reported in Oklahoma and Kansas. The current case count is 817 from Texas, New Mexico, Oklahoma, and Kansas. 97 individuals have required hospitalization, and 3 deaths, 2 children in Texas and one adult in New Mexico. These fatalities mark the first measles-related deaths in the United States since 2015 and the first pediatric measles death since 2003.
The YSPH Virtual Medical Operations Center Briefs (VMOC) were created as a service-learning project by faculty and graduate students at the Yale School of Public Health in response to the 2010 Haiti Earthquake. Each year, the VMOC Briefs are produced by students enrolled in Environmental Health Science Course 581 - Public Health Emergencies: Disaster Planning and Response. These briefs compile diverse information sources – including status reports, maps, news articles, and web content– into a single, easily digestible document that can be widely shared and used interactively. Key features of this report include:
- Comprehensive Overview: Provides situation updates, maps, relevant news, and web resources.
- Accessibility: Designed for easy reading, wide distribution, and interactive use.
- Collaboration: The “unlocked" format enables other responders to share, copy, and adapt seamlessly. The students learn by doing, quickly discovering how and where to find critical information and presenting it in an easily understood manner.
CURRENT CASE COUNT: 817 (As of 05/3/2025)
• Texas: 688 (+20)(62% of these cases are in Gaines County).
• New Mexico: 67 (+1 )(92.4% of the cases are from Eddy County)
• Oklahoma: 16 (+1)
• Kansas: 46 (32% of the cases are from Gray County)
HOSPITALIZATIONS: 97 (+2)
• Texas: 89 (+2) - This is 13.02% of all TX cases.
• New Mexico: 7 - This is 10.6% of all NM cases.
• Kansas: 1 - This is 2.7% of all KS cases.
DEATHS: 3
• Texas: 2 – This is 0.31% of all cases
• New Mexico: 1 – This is 1.54% of all cases
US NATIONAL CASE COUNT: 967 (Confirmed and suspected):
INTERNATIONAL SPREAD (As of 4/2/2025)
• Mexico – 865 (+58)
‒Chihuahua, Mexico: 844 (+58) cases, 3 hospitalizations, 1 fatality
• Canada: 1531 (+270) (This reflects Ontario's Outbreak, which began 11/24)
‒Ontario, Canada – 1243 (+223) cases, 84 hospitalizations.
• Europe: 6,814
2. Outlines
◉ What is Object-Oriented Programming ?
◉ Procedural vs. Object-Oriented Programming
◉ OO Programming Concepts
◉ Concept of Objects and classes
◉ UML Class Diagram
◉ Visibility Modifiers and Accessor Methods
◉ Full Example
5. Sample class
class Pencil {
public String color = “red”;
public int length;
public float diameter;
public static long nextID = 0;
public void setColor (String newColor) {
color = newColor;
}
}
6. o Java provides a number of access modifiers to help you set the
level of access you want for classes as well as the fields,
methods and constructors in your classes.
Access control modifiers
A member has package or
default accessibility when no
accessibility modifier is
specified.
A standard design strategy is to
make all fields private and
provide public getter methods
for them.
7. o private: private members are accessible only in the class itself.
o package: package members are accessible in classes in the same
package and the class itself.
o protected: protected members are accessible in classes in the
same package, in subclasses of the class, and in the class itself.
o public: public members are accessible anywhere the class is
accessible.
Access control modifiers
9. public class Pencil {
public String color = “red”;
public int length;
public float diameter;
private float price;
public static long nextID = 0;
public void setPrice (float
newPrice) {
price = newPrice;
} }
public class CreatePencil {
public static void main (String args[]){
Pencil p1 = new Pencil();
p1.price = 0.5f;
} }
Pencil.java
CreatePencil.java
10. o final
once initialized, the value cannot be changed.
often be used to define named constants.
static final fields must be initialized when the class is
initialized.
non-static final fields must be initialized when an object of
the class is constructed.
More Access control modifiers
12. o main method
o The system locates and runs the main method for a class
when you run a program
o Other methods get execution when called by the main
method explicitly or implicitly.
o Must be public, static and void.
main method
13. o A class can have more than one method with the same name as
long as they have different parameter list.
public class Pencil {
. . .
public void setPrice (float newPrice) {
price = newPrice;
}
public void setPrice (Pencil p) {
price = p.getPrice();
}
}
Overloading
14. o Parameters are always passed by value.
public void method1 (int a) {
a = 6;
}
public void method2 ( ) {
int b = 3;
method1(b); // now b = ?
// b = 3
}
Parameter Values
15. o When the parameter is an object reference, it is the object
reference, not the object itself, getting passed.
Parameter Values
public void method1 (Car a) {
…
}
16. class PassRef{
public static void main(String[] args) {
Pencil plainPencil = new Pencil("PLAIN");
System.out.println("original color: " +
plainPencil.color);
paintRed(plainPencil);
System.out.println("new color: " +
plainPencil.color);
}
public static void paintRed(Pencil p) {
p.color = "RED";
p = null;
}
}
Parameter is an object reference
color: PLAIN
color: PLAIN
color: RED
color: RED NULL
p
plainPencil
plainPencil
plainPencil p
plainPencil p
17. o If you change any field of the object which the parameter
refers to, the object is changed for every variable which holds a
reference to this object.
o You can change which object a parameter refers to inside a
method without affecting the original reference which is passed.
o What is passed is the object reference, and it’s passed in the
manner of “PASSING BY VALUE”!
Parameter is an object reference
18. o Constructors are a special kind of methods that are invoked to
construct objects.
Constructors
Circle() {
}
Circle(double newRadius) {
radius = newRadius;
}
19. o A constructor with no parameters is referred to as a no-arg
constructor.
o Constructors must have the same name as the class itself.
o Constructors do not have a return type—not even void.
o Constructors are invoked using the new operator when an object
is created.
o Constructors play the role of initializing objects.
Constructors
20. o A class may be defined without constructors. In this case, a no-
arg constructor with an empty body is implicitly defined in the
class.
o This constructor, called a default constructor, is provided
automatically only if no constructors are explicitly defined in the
class.
Constructors
21. Copying Variables of Object Types
i
Primitive type assignment i = j
Before:
1
j 2
i
After:
2
j 2
c1
Object type assignment c1 = c2
Before:
c2
c1
After:
c2
c1: Circle
radius = 5
C2: Circle
radius = 9
c1: Circle
radius = 5
C2: Circle
radius = 9
22. o As shown in the previous figure, after the assignment statement
c1 = c2, c1 points to the same object referenced by c2.
o The object previously referenced by c1 is no longer referenced.
o This object is known as garbage.
o Garbage is automatically collected by JVM.
Garbage Collection
The JVM will automatically collect the space of null object.
24. Instance Vs Static
o Static
o Variables are shared by all the
instances of the class.
o public static int x;
o Methods are not tied to a specific
object.
o public static void sum (int a, int b)
{… }
o Instance
o Variables belong to a specific
instance.
o public int x;
o Methods are invoked by an
instance of the class.
o public void sum (int a, int b)
{… }
26. o Static constants are final variables shared by all the instances
of the class.
Static constants
27. o The get and set methods are used to read and modify private
properties.
o The get and set methods are used to read and modify private
properties.
Accessor/Mutator Methods
public void getName( )
{
return name; // as example
}
public void setName(String name)
{
This.name = name; // as example
}
29. o An object cannot access its private members, as shown in (b). It
is OK, however, if the object is declared in its own class, as
shown in (a).
Static constants
30. Practices
Group 1
Develop 2 Accessor
Methods.
Group 2
Give 3 examples to
use final modefier.
Group 3
Diffrenciate between
Access modefiers.
Group 4
Give 3 examples to
overloaded methods.
Group 5
By drawing, Compare
between Copying
Variables primitives
data types and Object
Types.
Group 6
Develop a simple
class.