OOP MIDTERM

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/28

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

29 Terms

1
New cards

Java

  • created by James Gosling at Sun MicroSystems (subsidiary of Oracle Corporation) and released in 1995

  • initially “Greentalk” by James Gosling and its file extension is .gt then after that “Oak”

  • in 1995, it was renamed “Java” due to trademark by Oak Technologies

2
New cards

Features of Java

  • Simple

  • Object Oriented

  • Platform Independent

  • Secured

  • Robust

  • Architectural Normal

  • Portable

  • High Performance

  • Distributed

  • Multi-threaded

  • Dynamic

3
New cards

Variable

  • Something that can store a piece of data

  • Can also be called as a container that holds any value\

4
New cards

Two Type of Types

  1. Class Types

  2. Primitive Types

5
New cards

Class Types

A type for objects with both data and methods

6
New cards

Primitive types

A simple, indecomposable values

7
New cards

Constants

are identifiers whose values never change once declared. The general syntax for declaring constants is:

final <type> <identifier> = <literal>;

8
New cards

Casting

is the process of assigning a value or variable of a specific type to a variable of another type.

Example:

double x=10.0 , y=3.0;

int z;

z = (int) (x/y);

9
New cards

Primitive Data Types

  1. string

  2. boolean

  3. char

  4. byte

  5. short

  6. int

  7. long

  8. float

10
New cards

Assignment Statements

  • is to assign a value to a variable

  • Use of assignment operator “=”

  • Syntax: Variable_name = expression;

11
New cards

Operators

  • are symbols that perform logical or mathematical functions on operands such as variables, constants, and objects.

12
New cards

Unary Operators

require only one operand. In Java, there are at least four unary operators: negation (-), bitwise complement (~), increment (++), and decrement (--). These operators change the value of their operand without using an assignment operator (=).

13
New cards

Arithmetic Operators

+ Addition

- Subtraction

* Multiplication

/ Division

% Modulo

++ Increment

-- Decrement

14
New cards

Comparison / Relational Operators

>=

<

<=

==

!= 

15
New cards

Conditional / Logical Operators

! NOT

|| Logical OR

&& Logical AND

16
New cards

Shortcut Assignment Operators

+= Assignment with Addition

-= Assignment with Subtraction

*= Assignment with Multiplication

/= Assignment with Division

%= Assignment with Modulo

17
New cards

if-else Statement

knowt flashcard image
18
New cards

Rank of Operators

knowt flashcard image
19
New cards

Nested if-else

knowt flashcard image
20
New cards

if-else-if

knowt flashcard image
21
New cards

The Switch Statement

knowt flashcard image
22
New cards

Iterations

  • Repeating the same code fragment several times

  • Java provides three control statements for

    iterations (a.k.a. loops): for, while, and

    do-while.

23
New cards

The while loop

knowt flashcard image
24
New cards

The while loop

knowt flashcard image
25
New cards

The for loop

is a shorthand that combines in one statement initialization, condition, and change:

<p>is a shorthand that combines in one statement initialization, condition, and change:</p><p></p>
26
New cards

The do-while loop

knowt flashcard image
27
New cards

break

instructs the program to immediately quit the current iteration and go to the first statement following the loop.

28
New cards

return

instructs the program to immediately quit the current method and return to the calling method.

29
New cards

Nested Loops

A loop within a loop