CS 349 Java Final Exam

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/41

flashcard set

Earn XP

Description and Tags

These flashcards cover essential Java programming concepts and components relevant for the final exam.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

Encapsulation

Hiding internal details and showing only functionalities.

2
New cards

Inheritance

Mechanism where one class acquires properties of another.

3
New cards

Polymorphism

Ability of an object to take on many forms.

4
New cards

Abstraction

Hiding complex implementation details and showing only essentials.

5
New cards

Method Overloading

Same method name but different parameters.

6
New cards

Method Overriding

Child class redefines a parent method with same signature.

7
New cards

Constructor Rules

No return type; name must match class.

8
New cards

Implementing an Interface

Use 'implements' keyword in class declaration.

9
New cards

UML Class Diagram

Top: Class Name; Middle: Fields; Bottom: Methods.

10
New cards

Native Apps

Built specifically for Android/iOS platforms.

11
New cards

Web Apps

Accessed through a browser, not installed.

12
New cards

Hybrid Apps

Combination of native and web technologies.

13
New cards

RelativeLayout

Widgets positioned relative to others using IDs.

14
New cards

FrameLayout

Stacks multiple views on top of each other.

15
New cards

Good Layout Practice

Minimize layout depth for better performance.

16
New cards

Android Modes

Design Mode, Code Mode, Split Mode.

17
New cards

onCreate() Method

Initializes activity; sets content view.

18
New cards

setContentView()

Loads XML layout into an activity.

19
New cards

MVC Pattern in Android

Model: Data, View: UI Layouts, Controller: Activity logic.

20
New cards

Activity Component

Screen with a user interface.

21
New cards

Service Component

Runs background operations with no UI.

22
New cards

Broadcast Receiver

Listens for system-wide broadcast messages.

23
New cards

Content Provider

Shares data between apps, e.g., contacts.

24
New cards

What are the four main OOP principles in Java?

Encapsulation, Inheritance, Polymorphism, and Abstraction

25
New cards
Which method is used for executing SELECT statements in Java?
executeQuery()
26
New cards

Which method is used for INSERT, UPDATE, DELETE SQL statements

executeUpdate()

27
New cards

What are the three steps in Java Event Handling?

  1. Create Event Source

  2. Create Event Listener

  3. Register Listener with Source

28
New cards
Which method does ActionListener interface have?
actionPerformed(ActionEvent e)
29
New cards

How do you create a Button in Java?

Button b = new Button(""Click Me"");

30
New cards
How do you get text from a TextField in Java?
String text = tf.getText();
31
New cards
What is the syntax for inheriting a class in Java?
public class A extends C
32
New cards
How do you inherit a class and implement an interface in Java?
public class A extends C implements E
33
New cards
What does the @Override annotation indicate?
A method in a subclass is intended to override a method in its superclass
34
New cards

What are common methods inherited from Object class?

toString(), equals(), hashCode(), clone()

35
New cards
What is the purpose of interfaces in Java?
To define a contract that implementing classes must follow
36
New cards

What are the characteristics of fields in a Java interface?

All fields are public, static, and final

37
New cards
What are the characteristics of methods in a Java interface?
All methods are public and abstract by default
38
New cards
How is inheritance represented in UML diagrams?
Solid line with a hollow arrow pointing from child to parent
39
New cards
Why minimize layout hierarchy depth?
To improve performance
40
New cards
What does the Model do in MVC?
Manages data and business logic
41
New cards
What does the View do in MVC?
Displays UI via XML layouts
42
New cards
What does the Controller do in MVC?
Handles user input and updates model/view