Java Programming Tutorials — Source Code Examples, Arrays, GUI and Core Java Concepts
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.
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.
Arrays Java Source Code
The KeyboardAnimation2 applet provides a generic framework for applets both display an animation and respond to keyboard events. The animation
Java Source Code
This applet demonstrates various layout managers. The applet itself uses a border layout with a JPanel in the center, a
Java Source Code
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.
Game Development Java Source Code
This short program demonstrates the URL and URLConnection classes by attempting to open a connection to a URL and read
Java Source Code
This Java code is a simple console-based calculator that allows users to perform various mathematical operations. The calculator supports addition,
Java Source Code
This Java program demonstrates the essential concepts of exception handling using the try-catch-finally construct. Exception handling is crucial for dealing with unexpected errors that may occur during program execution.
Exception Java Source Code
Set up a Server that will receive packets from a client and send packets to a client. Also set up
Java Source Code
This applet simulates a network chat, in which the user chats with someone over a network. Here, there is no
Java Source Code