This document discusses abstraction and encapsulation in Scala. It defines abstraction as hiding internal details and showing only functionality. Abstraction can be achieved through abstract classes and interfaces/traits. Abstract classes can contain abstract and non-abstract methods, while interfaces contain only abstract methods. The document also discusses packages, which provide namespaces, and access modifiers like private, protected, and public, which restrict access to class members.
Object Oriented Programming For Engineering Students as well as for B.Tech -IT. Covers Almost All From The Basics.
For more:
Google Search:: Prabhaharan Ellaiyan
Structures in C# | C# Tutorial for Beginners | C# struct Examples | Working with C# Structures
In this c# tutorial, you can learn how to work with structures using dot net environment. Also it provides step by step examples for structures example, structures within a class, structures with constructors. This video will be helpful for those who are searching structures in c#.
Object Oriented Programming For Engineering Students as well as for B.Tech -IT. Covers Almost All From The Basics.
For more:
Google Search:: Prabhaharan Ellaiyan
Structures in C# | C# Tutorial for Beginners | C# struct Examples | Working with C# Structures
In this c# tutorial, you can learn how to work with structures using dot net environment. Also it provides step by step examples for structures example, structures within a class, structures with constructors. This video will be helpful for those who are searching structures in c#.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...ssuser7dcef0
Power plants release a large amount of water vapor into the
atmosphere through the stack. The flue gas can be a potential
source for obtaining much needed cooling water for a power
plant. If a power plant could recover and reuse a portion of this
moisture, it could reduce its total cooling water intake
requirement. One of the most practical way to recover water
from flue gas is to use a condensing heat exchanger. The power
plant could also recover latent heat due to condensation as well
as sensible heat due to lowering the flue gas exit temperature.
Additionally, harmful acids released from the stack can be
reduced in a condensing heat exchanger by acid condensation. reduced in a condensing heat exchanger by acid condensation.
Condensation of vapors in flue gas is a complicated
phenomenon since heat and mass transfer of water vapor and
various acids simultaneously occur in the presence of noncondensable
gases such as nitrogen and oxygen. Design of a
condenser depends on the knowledge and understanding of the
heat and mass transfer processes. A computer program for
numerical simulations of water (H2O) and sulfuric acid (H2SO4)
condensation in a flue gas condensing heat exchanger was
developed using MATLAB. Governing equations based on
mass and energy balances for the system were derived to
predict variables such as flue gas exit temperature, cooling
water outlet temperature, mole fraction and condensation rates
of water and sulfuric acid vapors. The equations were solved
using an iterative solution technique with calculations of heat
and mass transfer coefficients and physical properties.
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSveerababupersonal22
It consists of cw radar and fmcw radar ,range measurement,if amplifier and fmcw altimeterThe CW radar operates using continuous wave transmission, while the FMCW radar employs frequency-modulated continuous wave technology. Range measurement is a crucial aspect of radar systems, providing information about the distance to a target. The IF amplifier plays a key role in signal processing, amplifying intermediate frequency signals for further analysis. The FMCW altimeter utilizes frequency-modulated continuous wave technology to accurately measure altitude above a reference point.
We have compiled the most important slides from each speaker's presentation. This year’s compilation, available for free, captures the key insights and contributions shared during the DfMAy 2024 conference.
2. UNIT - IV
Abstraction and Encapsulation
Abstraction: Abstract Methods - Abstract Class and its importance –
implementation of abstraction – Encapsulation: Packages - Access
Modifiers – application of encapsulation - Type Class and Conversions.
3. Abstraction
⮚Abstraction is the process to hide the internal details and showing only the
functionality.
⮚In Scala, abstraction is achieved by using an abstract class.
⮚an abstract class is constructed using the abstract keyword.
⮚Abstraction can be achieved in two ways.
⮚Abstract method
⮚Non-abstract method
⮚Interface
5. Abstract Methods
• The abstract methods of abstract class are those methods which do not
contain any implementation. Or in other words, the method which does
not contain body is known as an abstract method.
Syntax:
abstract class class-name{
def method-name()
}
6. Non-abstract Methods
• These methods are those methods that define their implementation as well at the
time of declaring themselves. They contain their body that means the actual logic
inside them, so we can say that this logic is not hiding with the user because we
are providing the implementation so they cannot give us full abstraction.
• Syntax:
abstract class class-name {
def method-name(){
// you can write your logic here
} }
7. Interface
• using the interface we can achieve 100% abstraction. In Scala, we use trait
keyword to define an interface
• Syntax:
trait class-name {
def method-name(): Unit
def method-name(): Unit
}
8. Examples of Scala Abstract Class
• We have one Bank as a parent bank for all its sub banks. But the benefits
they are providing to their customers vary from each other like the rate of
interest they are giving is different from bank to bank. so, in this case, we
can have our print class as Bank and all other child classes are like SBI,
ICICI, IDBI, BOI, and many more.
9. Difference Between Traits and
Abstract Classes in Scala
• In Scala, an abstract class is constructed using the abstract keyword.
• It contains both abstract and non-abstract methods and cannot support
multiple inheritances.
• Traits can have methods(both abstract and non-abstract), and fields as its
members.
• Traits are just like interfaces in Java.
• But they are more powerful than the interface in Java because in the traits
we are allowed to implement the members.
11. Packages
Package in Scala is a mechanism to encapsulate a group of classes, sub
packages, traits and package objects.
It basically provides namespace to put our code in a different files and
directories.
Packages is a easy way to maintain our code which prevents naming
conflicts of members of different packages.
13. Declaration of Package
Packages are declared as a first statement at the top of a Scala file.
Syntax :
package package_name
// Scala classes
// traits
// objects..
14. Defining a package
Defining a package can be done in different ways:-
Chained methods
package x.y.z
// members of z
or can be used as:-
package x
package y
package z
// member of z
15. Defining a package
Nesting packages
package x{
// members of x {as required}
package y{
// members of y{as required}
package z{
// members of z{as required}
}
} }
16. How Package works
Packages binds together the data in a single file or works as data
encapsulation, when a file is saved it comes under default package or
under a package name as specified at the top of the file.
For example if a package name is college.student.cse, then there will be
3 directories, college, student and cse. Such that cse is present in student
and student is present in college.
17. Different ways to use import statements
1. Importing all public members of package.
import college._
//imports all college members students, faculties, houseKeeping etc.
2. Imports only selected members of a package.
import college.{faculty, houseKeeping}
//member student is not selected hence cannot be used in current file
3. Imports and rename the members.
import college.{student => stu}
//stu is used in-place of student
19. Access Modifiers
we can restrict the members from being accessible to certain areas of the
code.
20. Private Modifiers
Private members are available only inside the class or to the object
containing the member definition.
The private access modifier can be used for variables and methods as
well.
21. Protected Modifiers
Protected members can be accessed from subclasses of the class in which
the member is defined (inherited class).
This can also be used for methods as well as variables.
22. Public Modifiers
The default access modifier is public.
When the keywords private or protected is not specified then the
members are treated as public by the compiler and we don’t have to
explicitly specify the keyword “public”.
https://www.simplilearn.com/tutorials/java-tutorial/java-encapsulation
https://www.scientecheasy.com/2020/07/encapsulation-in-java.html/