JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Interfaces as a set of methods, implicit implementation

    Go SELF
    24 level,0 lecture
    We break down interfaces in Go as a set of methods (method set): why an interface describes only behavior, why you can’t require fields, and how implicit implementation works without the implements keyword. In practice, we build an extension point using TaskFormatter and the PrintTasks function, look at standard library interfaces ( error, fmt.Stringer), reinforce the idea with a mermaid diagram, and analyze typical mistakes (fields through an interface, “almost matching signature”, interfaces that are too large).
    Open
  • Interface value: (type, value)

    Go SELF
    24 level,1 lecture
    We break down why an interface in Go is not a “box,” but a pair (dynamic type, dynamic value), and where the typed nil trap comes from: when err prints like nil, but the comparison err != nil is unexpectedly true. Using practical examples with error, fmt.Stringer, and diagnostics via fmt.Printf( "%T"), we reinforce the rule: on the success path, return exactly nil, not (*T)(nil) packaged into an interface.
    Open
  • Small interfaces: how to design “the Go way”

    Go SELF
    24 level,2 lecture
    We break down a practical Go principle: an interface is the price of a contract. We learn to design dependencies around minimal behavior (for example, TaskLister with the List() method), separate reads and writes ( TaskAdder, TaskCompleter), compose contracts via embedding ( TaskStore), spot “combine harvesters” like MegaTaskService, and refactor them into small interfaces without unnecessary dependencies and stubs.
    Open
  • Where to declare interfaces

    Go SELF
    24 level,3 lecture
    Let’s break down a practical Go rule: interfaces are most often declared on the consumer side—where the code depends on the abstraction and wants to call methods without knowing the implementation. Using a mini example Tasker, we’ll see why a type interface like TaskStore makes more sense to keep in the tasker package rather than in memstore, how this affects dependencies, the public API, and swapping implementations ( EmptyStore, different stores), and what mistakes are made most often when choosing where an interface should live.
    Open
  • How method sets affect interface implementations

    Go SELF
    24 level,4 lecture
    We break down how a method set ( method set) in Go depends on the receiver and why an interface can accept * T but not T. Using the TaskStore interface and the MemStore implementation, we will see the classic “ Add has pointer receiver” mistake, understand the difference between a convenient method call and verifying an interface implementation, learn to diagnose a dynamic type via fmt.Printf( "%T", x), and avoid the typed nil trap in interfaces like error.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush