Java FDM | Questions & Answers (100 %Score) Latest Updated 2024/2025 Comprehensive
Questions A+ Graded Answers | With Expert Solutions
List the four pillars of OOP - APIE
Abstraction
Polymorphism
Inheritance
Encapsulation
Encapsulation - The act of grouping together data and behaviour into logical
components.
Abstraction - Extracting relevant and essential
information and behavior. Hiding complexity through layering
Cohesion - is the degree to which components of a class belong together. Group data
and / or behaviors into logical components. Good design aims for high cohesion
Coupling should be low or high - Good design aims to achieve low coupling.
Inheritance - provides an object with the ability to acquire the fields and methods of
another class, called base class. IS-A
Polymorphism - Having multiple forms or versions of the same type of thing and the
same types of behavior.
List the two types of binding. - Two main types
Early Binding (Compile time)
Occurs at compile time
Attributes and method calls are bound when
compiling source code
Late Binding (Runtime)
Occurs at runtime
Attributes and method calls are bound when the
program is running
Overloading - Two methods in the same class have the same name but different
parameters.
+updateDetails(String u)
+updateDetails(String u, String p)
Polymorphism - Early Binding/Overloading
Overriding - If a subclass provides a specific implementation of a method that is already
provided by its parent class, it is known as Method Overriding.
Polymorphism - Late Binding/Overriding
, Fill in the data types
?
8
16
32
64 - ? boolean
8 byte
16 short char
32 int float
64 long double
Is Java compiled or interpreted - Both
Strings - immutable
reference types not primitives
String literals are stored in the String Pool
compared using the .equals method NOT ==
concatenation creates a new String
StringBuilder and StringBuffer - StringBuffer Thread safe but slower
StringBuilder Not Thread safe but faster
Arrays - are a way of containing multiple variables.
are reference types
Indices start at zero
Enum - are a way to represent a set of predefined values.
Primitive wrapper classes - Classes that wrap a primitive value and provide additional
functionality.
Wrappers for numeric types extend the Number class.
BigDecimal - fixes many issues with floats and doubles:
Has custom defined rounding modes to suit the situation
Calendar class - Date and time are handled by the Calendar class.
Calendar provides methods to get the value of a specific
field:Day,Month,Year,Hour,Minute
What does IDE stand for - Integrated Development Environment
What is m2e - Maven Integration for Eclipse
Subclipse - Subversion integration for Eclipse
Questions A+ Graded Answers | With Expert Solutions
List the four pillars of OOP - APIE
Abstraction
Polymorphism
Inheritance
Encapsulation
Encapsulation - The act of grouping together data and behaviour into logical
components.
Abstraction - Extracting relevant and essential
information and behavior. Hiding complexity through layering
Cohesion - is the degree to which components of a class belong together. Group data
and / or behaviors into logical components. Good design aims for high cohesion
Coupling should be low or high - Good design aims to achieve low coupling.
Inheritance - provides an object with the ability to acquire the fields and methods of
another class, called base class. IS-A
Polymorphism - Having multiple forms or versions of the same type of thing and the
same types of behavior.
List the two types of binding. - Two main types
Early Binding (Compile time)
Occurs at compile time
Attributes and method calls are bound when
compiling source code
Late Binding (Runtime)
Occurs at runtime
Attributes and method calls are bound when the
program is running
Overloading - Two methods in the same class have the same name but different
parameters.
+updateDetails(String u)
+updateDetails(String u, String p)
Polymorphism - Early Binding/Overloading
Overriding - If a subclass provides a specific implementation of a method that is already
provided by its parent class, it is known as Method Overriding.
Polymorphism - Late Binding/Overriding
, Fill in the data types
?
8
16
32
64 - ? boolean
8 byte
16 short char
32 int float
64 long double
Is Java compiled or interpreted - Both
Strings - immutable
reference types not primitives
String literals are stored in the String Pool
compared using the .equals method NOT ==
concatenation creates a new String
StringBuilder and StringBuffer - StringBuffer Thread safe but slower
StringBuilder Not Thread safe but faster
Arrays - are a way of containing multiple variables.
are reference types
Indices start at zero
Enum - are a way to represent a set of predefined values.
Primitive wrapper classes - Classes that wrap a primitive value and provide additional
functionality.
Wrappers for numeric types extend the Number class.
BigDecimal - fixes many issues with floats and doubles:
Has custom defined rounding modes to suit the situation
Calendar class - Date and time are handled by the Calendar class.
Calendar provides methods to get the value of a specific
field:Day,Month,Year,Hour,Minute
What does IDE stand for - Integrated Development Environment
What is m2e - Maven Integration for Eclipse
Subclipse - Subversion integration for Eclipse