Methods (OOP) (OCR A-Level Computer Science): Flashcards

📚Flashcards
Methods (OOP)
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

Methods in OOP (definition)

Functions defined within a class representing object behaviours

Public methods accessibility

Accessible from outside the class

Public methods role

Primary interface of a class for external interaction

Public methods encapsulation benefit

Allow access without exposing internal workings of class

Private methods accessibility

Intended for internal use only, not accessible externally

Private methods Python naming

Marked by leading underscore (e.g., _method_name)

Private methods purpose

Perform auxiliary/supportive tasks within the class

Private methods security benefit

Help keep implementation details hidden (encapsulation)

Accessing private methods externally

Should be avoided (breaks convention/encapsulation)

Python private method convention

Should start with single underscore

Private methods & data security

Help protect internal processes, promoting encapsulation

Modular design with private methods

Segment complex actions into smaller, maintainable methods

Join 100,000+ A-Level students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.