Java: Classes and objects Exam 2025
Questions and Answers
OOP - ANSWER✔✔-Object-Oriented Programming
Attributes - ANSWER✔✔-Characteristics in an object. For example, a car can be red or
blue
Behavior - ANSWER✔✔-Dependent on the object type
Three dimensions in object oriented - ANSWER✔✔-Identity
Attributes
Behavior
Class - ANSWER✔✔-Describes what an object will be. It is a blueprint, description,
definition of an object
Class syntax - ANSWER✔✔-Very beginning!
public class (name class here) {
, Method - ANSWER✔✔-Synonymous for behavior
Coding def: a collection of statements that are grouped together to perform an
operation
Declaring a method - ANSWER✔✔-class Myclass{
static void sayHello(){
//sayHello is the method
System.out.println("Hello World!")
}
public static void main (String [ ] args) {
sayHello();
sayHello();
sayHello();
}
}
Questions and Answers
OOP - ANSWER✔✔-Object-Oriented Programming
Attributes - ANSWER✔✔-Characteristics in an object. For example, a car can be red or
blue
Behavior - ANSWER✔✔-Dependent on the object type
Three dimensions in object oriented - ANSWER✔✔-Identity
Attributes
Behavior
Class - ANSWER✔✔-Describes what an object will be. It is a blueprint, description,
definition of an object
Class syntax - ANSWER✔✔-Very beginning!
public class (name class here) {
, Method - ANSWER✔✔-Synonymous for behavior
Coding def: a collection of statements that are grouped together to perform an
operation
Declaring a method - ANSWER✔✔-class Myclass{
static void sayHello(){
//sayHello is the method
System.out.println("Hello World!")
}
public static void main (String [ ] args) {
sayHello();
sayHello();
sayHello();
}
}