Java Programming Tutorials — Source Code Examples, Arrays, GUI and Core Java Concepts

Flat isometric illustration of a monitor displaying Java code with coffee cup icon GUI window frame and class inheritance diagram in blue

Java remains one of the most widely used programming languages in the world — taught in universities, used in enterprise systems, and powering billions of devices through the Java Virtual Machine. Its write-once-run-anywhere philosophy, strong object-oriented foundation and rich standard library make it a first-choice language for students learning programming fundamentals and professionals building scalable enterprise applications.

MYCPLUS has been publishing Java programming tutorials and source code examples since 2004. This section covers Java from the ground up — starting with core language fundamentals and progressing through practical topics including arrays and data structures, graphical user interface development with Java Swing and AWT, object-oriented design patterns and real-world application examples you can compile and run immediately.

With over 45 articles covering beginner through advanced Java concepts, you will find clear explanations of Java syntax and core programming principles, practical source code examples for common programming challenges, and hands-on GUI tutorials that show how to build interactive Java applications from scratch. Whether you are a student working through your first Java course, a developer brushing up on fundamentals, or a programmer transitioning from C++ or Python — this section gives you the practical Java resources you need.

What You’ll Learn:

  • Core Java fundamentals — variables, data types, control flow, methods, constructors and the foundational Java programming model explained with practical examples
  • Arrays and data structures in Java — single and multi-dimensional arrays, ArrayList, LinkedList, stacks, queues and practical data structure implementations in Java
  • Object-oriented programming in Java — classes, inheritance, polymorphism, interfaces, abstract classes and encapsulation with real-world Java source code examples
  • Java GUI development — building graphical user interfaces with Java Swing and AWT, event handling, layout managers, buttons, forms and interactive application design
  • Java collections and generics — working with the Java Collections Framework, iterators, generics, Maps and Sets for efficient data management in Java applications
  • Practical Java source code — ready-to-compile Java programs covering algorithms, sorting, searching, file handling and common programming challenges for hands-on learning

Why MYCPLUS: Trusted by Java developers and students since 2004 — every tutorial includes working source code you can compile and run immediately, with clear explanations designed for real-world Java programming skills.

Java Dynamic Arrays - Integers

Java Dynamic Arrays – Integers

The DynamicArrayOfInt class is a simple implementation of a dynamic array in Java. A dynamic array is a resizable array that can grow or shrink in size as needed. This class provides methods to manipulate and interact with this dynamic array of integers. In the constructor, initially the data array has a size of 1 and grows as necessary.

Moving ball applet – Java

This is a Java class that uses some trigonometry and vector mathematics in its implementation.  An object of type MovingBall holds data about a “ball” that has a color, radius, position, speed, and direction. The ball is restricted to moving around inside a rectangle in the xy-plane. The ball can draw itself in a graphics context and will move when it is told to move.

Scroll to Top