[OOP] Flashcards - Module 1

(62 cards)

1
Q

[syntax] reading a character

A

scanner_name.next().charAt(0);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

8 data types in java

A

char, boolean, byte, int, short, long, float, double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

the only object that is defined, when a class is initially defined.

A

description

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

refer to an object’s state.

A

Attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

include defining the class encapsulating data and methods.

A

Class Definitions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

This is also known as automatic type promotion.

A

Implicit Typecasting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

[syntax] typecasting char to int (for ASCII Value) and vice versa

A

int asciiValue = (int) ch ;
char ch = (char) asciiValue;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

[syntax] String content comparison

A

boolean <var_name> = str1.equals(str2); (result is either true or false)</var_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Backslash and backspace escape sequence

A

\ and \b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

the principle where objects can share behaviors and adopt multiple forms.

A

Polymorphism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Double/Single quote escape sequence

A

" and '

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

characteristics distinguishing classes.

A

Attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

[syntax] string input using a scanner in java

A

String str = scanner_name.nextLine():

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

errors that occur during the execution of the program.

A

Runtime Error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In initializing characters, they should be enclosed in ____

A

single quotes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A form of typecasting that requires the programmer to specify the desired data type.

A

explicit typecasting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

OOP Building Blocks

A

Classes, Objects, Methods, and Attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

the syntax or semantic errors detected at compile time.

A

Compile-time Errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Basic Structure of Java

A

Package Declarations, Import Statements, Class Definitions, main() method, Statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The data stored by the objects are kept in this field.

A

attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Import Statements in Java

A

java.util., java.io., java.net., java.math.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

used by programmers for reusability or keeping the functionality encapsulated inside one object at a time.

A

Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

a principle where objects expose only the internal mechanisms necessary for other objects to function,

A

Abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

principle that dictates that an object contains all its essential information, with only selected details made accessible.

A

Encapsulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
includes external classes and libraries into the program.
Import Statements
26
subroutines contained in an object
instance methods
27
Scanner method that reads a word (string without spaces)
scanner_name.next();
28
a concept that allows classes to inherit code and properties from other classes.
Inheritance
29
Java is a programming language developed by ____ in the mid-____ known for its versatility, efficiency, and platform independence.
Sun Microsystems ; 1990s
30
the instructions executed by the program within methods.
Statements
31
occurs when the compiler automatically converts a value from one data type to another without explicit instructions from the programmer.
implicit typecasting
32
contains the Collections framework, formatted printing, and scanning.
java.util.*
33
Errors that lead to incorrect results
Logical Errors
34
is the package for input and output functionalities.
java.io.*
35
character sequences surrounded by double quotes.
strings
36
the package including classes for performing arithmetic operations.
java.math.*
37
Java operates on the "_____" principle,
write once, run anywhere
38
[syntax] declaring a new scanner in java
Scanner = new Scanner(System.in);
39
deals about creating objects that contain both data and functions.
Object-Oriented Programming
40
the rules that define how words and punctuation are organized in a programming language.
Syntax
41
These represent an abstract entity.
objects
42
[syntax] String lexicographic comparison
int = str1.compareTo(str2); (result is 0 = equal, (-) = str1 < str2, and (+) = str1> str2
43
describes the relationship between classes,
Association
44
the instances of a class created with specifically defined data.
Objects
45
special character combinations allowing you to represent the characters that are not printed using the normal way of printing.
Escape Sequences
46
refer to those functions that the objects can perform, defined inside the class.
Methods
47
[syntax] closing a scanner
scanner_name.close();
48
A single- line comment in Java starts with ____ and multiline comments are enclosed between ____
// ; /* */
49
The object behaviors are described in this
Methods
50
Carriage return and form feed escape sequence
\r and \f
51
contains networking capabilities.
java.net.*
52
OOP Principles
Encapsulation, Abstraction, Inheritance, Polymorphism, Syntax, Coupling, Association
53
[syntax] string copying
String str2 = str1.substring(0);
54
it is where the program execution begins
main() method
55
also known as format specifiers, are essential for displaying variable values in output statements in Java.
Placeholder
56
refers to the degree of dependency between software components.
Coupling
57
optional, and used for class organizations.
Package Declarations
58
Errors in Java
Compile-time Errors, Runtime Errors, Logical Errors
59
also known as type conversion is the process of converting a value from one data type to another, allowing you to modify the interpretation of a value.
Typecasting
60
Syntax Rules in Java
Case Sensitive, Class names start with uppercase, method names start with lowercase, file name = class name
61
Newline and Tab Escape sequence
\n and \t
62
the user-defined data types acting as the blueprint for individual objects, attributes, and methods.
Classes