Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack safer

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
012345678901234567890123456789012345678901234567890123456789
Yesterday
012345678901234567890123456789012345678901234567890123456789
Total views
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

Java docs
Java
Getting StartedSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts
Discussions

Java guide · 3/6

Types and Data

Every Java value is either a primitive or a reference to an object. This chapter covers that split, arrays, your own types (classes, interfaces, records, enums), generics, and the everyday collections List, Map, and Set.

Primitives versus objects

Primitives hold their value directly and can never be null. Everything else is an object, and a variable of an object type holds a reference to it.

PrimitiveSizeWrapper class
byte, short, int, long8, 16, 32, 64-bit integersByte, Short, Integer, Long
float, double32, 64-bit floating pointFloat, Double
charone 16-bit UTF-16 code unitCharacter
booleantrue or falseBoolean

Collections store only objects, so an int is wrapped in an Integer automatically (autoboxing). Watch for two pitfalls: == on wrappers compares references, so use equals, and unboxing a null throws NullPointerException.

int a = 1_000; // underscores for readability
long big = 9_000_000_000L; // long literals need an L
double pi = 3.14159;

Integer x = 1000; // autoboxing
Integer y = 1000;
System.out.println(x.equals(y)); // true
System.out.println(x == y); // reference comparison, may be false

int parsed = Integer.parseInt("42");
String text = String.valueOf(parsed);

Arrays

An array is a fixed-length sequence of one type. Its size is in the length field, indexes start at zero, and going out of bounds throws ArrayIndexOutOfBoundsException. java.util.Arrays has helpers for sorting and printing.

int[] scores = {90, 75, 88};
String[] names = new String[3]; // every slot starts as null
names[0] = "Duke";

java.util.Arrays.sort(scores);
System.out.println(java.util.Arrays.toString(scores)); // [75, 88, 90]

int[][] grid = new int[2][3]; // 2 rows, 3 columns
grid[1][2] = 7;

For data that grows or shrinks, use a collection such as ArrayList.

Classes, interfaces, records, and enums

An interface is a contract of methods to implement, optionally with shared default methods. A class can implement many interfaces but extend only one class.

Records declare immutable data carriers concisely; the compiler generates the constructor, accessors, equals, hashCode, and toString. Accessors are named after the components: radius(), not getRadius().

interface Shape {
    double area();
    default String describe() {
        return getClass().getSimpleName() + " area=" + area();
    }
}

record Circle(double radius) implements Shape {
    Circle { // compact constructor for validation
        if (radius < 0) throw new IllegalArgumentException("radius < 0");
    }
    public double area() { return Math.PI * radius * radius; }
}

record Rect(double width, double height) implements Shape {
    public double area() { return width * height; }
}

enum Status {
    ACTIVE("active"), SUSPENDED("suspended");
    private final String label;
    Status(String label) { this.label = label; }
    String label() { return label; }
}

An enum turns a fixed set of constants into a real type. It can carry fields and methods, works naturally with switch, and provides valueOf and values() for free.

Generics basics

Generics parameterize code by type, so one implementation serves many types while the compiler checks everything up front instead of leaving casts for runtime. Type arguments must be reference types, which is why you write List<Integer> rather than List<int>.

record Pair<A, B>(A first, B second) {}

static <T extends Comparable<T>> T max(java.util.List<T> items) {
    T best = items.get(0);
    for (T item : items) {
        if (item.compareTo(best) > 0) best = item;
    }
    return best;
}

var pair = new Pair<>("age", 30); // diamond operator infers the types
String key = pair.first();
int biggest = max(java.util.List.of(3, 9, 4)); // 9

A bound such as T extends Comparable<T> lets you call that type's methods inside the generic code. For parameters you only read from, wildcards like List<? extends Number> make an API accept more argument types.

Collections: List, Set, and Map

The collections framework in java.util separates interfaces from implementations. The convention is to declare variables with the interface type and pick the implementation that suits the job.

InterfaceCommon implementationsBehavior
ListArrayList, LinkedListOrdered, duplicates allowed
SetHashSet, LinkedHashSet, TreeSetNo duplicates
MapHashMap, LinkedHashMap, TreeMapKey-value pairs
import java.util.*;

List<String> langs = new ArrayList<>(List.of("Java", "Go"));
langs.add("Rust");
langs.remove("Go");

Set<String> tags = new HashSet<>();
tags.add("jvm");
tags.add("jvm"); // duplicate is ignored
System.out.println(tags.size()); // 1

Map<String, Integer> stock = new HashMap<>();
stock.put("apple", 3);
stock.merge("apple", 2, Integer::sum); // 5
int pears = stock.getOrDefault("pear", 0);
for (Map.Entry<String, Integer> e : stock.entrySet()) {
    System.out.println(e.getKey() + "=" + e.getValue());
}

List<Integer> fixed = List.of(1, 2, 3); // unmodifiable

Collections from List.of, Set.of, and Map.of are unmodifiable, and add throws UnsupportedOperationException; copy them into a mutable collection, as in the first line, when you need changes. HashMap and HashSet promise no order: use LinkedHashMap for insertion order or TreeMap for sorted keys.

Summary

  • Primitives store values; object variables store references. Compare objects with equals.
  • Arrays have a fixed length; use collections for data that grows or shrinks.
  • Records model immutable data, enums model fixed sets of constants, and interfaces define contracts.
  • Generics give type-safe reuse, and List, Set, and Map cover most everyday data structures.
Questions about this chapter?
Previous chapterSyntax BasicsNext chapterModules and Packages

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.