Introduction to Java Flashcards
What does OOP stand for?
Object Oriented Programming
what does OOP help with?
OOP simplifies software development and maintenance by providing some rules
In OOP languages everything is associated with?
classes, objects, attributes and methods
a class is _______________ or generic description
blueprint
a class contains?
general attributes or properties
Objects are created from a _________
class
TRUE or FALSE…
an object represents specific attributes values that apply
True
TRUE or FALSE…
Attributes is the information stored in a method.
False. Attributes is the information stored within an object. It represents the data of an object.
Method represents what…methods perform what…..
methods represents behaviors and perform actions.
What are the main data types?
int
float
char
boolean
string
what is a variable?
a variable is used to store values in Java for later use.
example int age = 65; or String name = “Jonny”
what is an array used to store?
multiple values in a single variable
Which of the following is the correct way to code an array?
A. String [] trees = {"oak, spruce, pine"}; B. String trees [] = {"oak", "spruce", "pine"}; C. String trees = {"oak", "spruce", "pine"}; D. String [] trees = {"oak", "spruce", "pine"};
D.
String [] trees = {“oak”, “spruce”, “pine”};
What is the code needed to make this if work?
String color = "red"; if (color == "blue") { System.out.println("I'm sorry please pick red"); } elseif { System.out.println("RED"); }
elseif should look like elseif (color == “red”)
String color = “red”;
if (color == "blue") { System.out.println("I'm sorry please pick red"); } elseif (color == "red") { System.out.println("RED"); }
What is a class?
a structure where we define attributes and methods, which are utilized by the objects.