Classes and the String class

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:49 AM on 8/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

25 Terms

1
New cards

What is a class?

A class is the name for a type whose values are objects.

2
New cards

What is an object?

An entity that stores data and takes actions.

3
New cards

What do objects belonging to the same class have in common?

They have the same methods.

4
New cards

Can objects belonging to the same class have different data?

Yes, each object can have different data values.

5
New cards

What are the actions that an object can take called?

Methods

6
New cards

What can a method do?

It can return a value of a single type and or perform an action.

7
New cards

What is the general syntax for calling a method?

object.method(arguments)

8
New cards

Are Java strings immutable?

Yes

9
New cards

How are Java strings similar to Python strings?

They are both immutable.

10
New cards

What is a major difference between manipulating strings in Java and Python?

Java uses method calls where Python uses operators.

11
New cards

Can you access a character in a Java string?

Yes using a method called charAt()

12
New cards

Can you obtain a substring from a Java string?

Yes using substring()

13
New cards

What does substring() do?

It returns a substring from a specified starting position up to, but not including, the specified ending position.

14
New cards

What does indexOf() do?

Finds the first occurrence of a specified character/string.

15
New cards

What symbol indicates an escape sequence?

A backslash immediately preceding a character.

16
New cards

What happens to the character following a backslash?

It does not have its usual meaning.

17
New cards

How many characters is an escape sequence regarded as?

One character, even though it is formed using 2 symbols.

18
New cards

How does a Java line comment begin?

//

19
New cards

How does a Java block comment begin?

/*

20
New cards

How does a Java block comment end?

*/

21
New cards

What is the difference between // and /* */?

// is a line comment, while /* */ is a block comment that can span multiple lines.

22
New cards

What is javadoc?

A java program that automatically extracts documentation from documentation comments in classes.

23
New cards

What makes a block comment a documentation comment recognised by javadoc?

It begins with /**

24
New cards

What does a well-written program mean by being "self-documenting"?

Its structure and purpose are made clear through meaningful identifier names and proper indentation.

25
New cards

How should nested structures be indented?

The structure inside another structure should be indented one additional level.