#basics

18 snippets tagged with #basics

javabeginner

Reverse a String in Java

Multiple ways to reverse a string in Java including StringBuilder, char array, and stream approaches.

Best for: String manipulation in coding interviews

#java#string
javabeginner

Java Date/Time API — Modern Operations

Work with LocalDate, LocalDateTime, ZonedDateTime, Duration, Period, and date formatting.

Best for: Date arithmetic and business day calculations

#java#date-time
javabeginner

Try-With-Resources and AutoCloseable

Manage resources safely with try-with-resources: files, connections, streams, and custom resources.

Best for: Safe resource management preventing leaks

#java#resource-management
kotlinbeginner

Null Safety — Elvis, Safe Call, and let

Master Kotlin null safety: safe calls, Elvis operator, let/also scoping, and smart casts.

Best for: Safe navigation through nullable chains

#kotlin#null-safety
kotlinbeginner

Data Classes — Copy, Destructure, and Equals

Use data classes for immutable models: auto-generated equals, hashCode, copy, and destructuring.

Best for: Immutable domain models and DTOs

#kotlin#data-class
kotlinbeginner

Scope Functions — let, run, apply, also, with

Master Kotlin scope functions: when to use let, run, apply, also, and with for concise code.

Best for: Object initialization and configuration

#kotlin#scope-functions
kotlinbeginner

Collections — map, filter, groupBy, and More

Master Kotlin collections: functional transformations, aggregations, grouping, and partition operations.

Best for: Data processing and transformation pipelines

#kotlin#collections
kotlinbeginner

Companion Objects — Static-Like Members and Factories

Use companion objects for factory methods, constants, and implementing interfaces at the class level.

Best for: Factory methods with validated construction

#kotlin#companion-object
kotlinbeginner

Object Declarations — Singletons and Anonymous

Use object declarations for singletons, anonymous objects, and object expressions in Kotlin.

Best for: Thread-safe singleton services

#kotlin#object
kotlinbeginner

Enum Classes — Advanced Patterns

Use Kotlin enum classes with properties, methods, interfaces, and companion utilities.

Best for: Type-safe constant sets with behavior

#kotlin#enum
kotlinbeginner

Destructuring Declarations

Destructure objects into variables: data classes, maps, pairs, and custom componentN operators.

Best for: Clean variable extraction from complex objects

#kotlin#destructuring
kotlinbeginner

Ranges, Progressions, and Coercion

Use Kotlin ranges: IntRange, custom progressions, coerceIn, and range-based iteration patterns.

Best for: Score and category classification

#kotlin#ranges
kotlinbeginner

Suspend Functions — Basics and Patterns

Understand suspend functions: sequential vs concurrent, suspend composition, and callback wrapping.

Best for: Sequential vs concurrent API calls

#kotlin#coroutines
kotlinbeginner

Kotlin Null Safety Complete Guide

Master null safety: safe calls, elvis operator, let/also/run, smart casts, and nullable collection handling.

Best for: Safe handling of nullable data from APIs

#kotlin#null-safety
scalabeginner

Scala Hello World Application

Create a basic Scala application with main method, string interpolation, and val/var basics.

Best for: Getting started with Scala

#scala#basics
scalabeginner

Pattern Matching Fundamentals

Use Scala pattern matching with guards, type patterns, tuple patterns, and nested extractors.

Best for: Control flow with pattern matching

#scala#pattern-matching
scalabeginner

Tuples and Product Types

Work with Scala 3 tuples: named tuples, tuple operations, conversions, and generic programming.

Best for: Returning multiple values from functions

#scala#tuples
scalabeginner

List Operations Basics

Essential list operations: head, tail, cons, zip, groupBy, sliding, partition, and span.

Best for: Data processing and transformation

#scala#list