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 Java code implements a simple graphical application that visually represents and counts blobs within a grid by using recursion. A blob is a group of adjacent filled squares in the grid. The application uses Java Swing for creating the graphical user interface (GUI) components. It includes buttons for generating a new set of blobs, counting the number of blobs, and a grid where users can click to get information about the blob size at that specific position. This Java code uses recursion in the getBlobSize method to calculate the size of a blob.
Algorithms Java Source Code
What is Java Programming Language? The Java programming language is a high-level language that can be characterized by all of
Java
A little applet that demonstrates JRadionButton with a group of radio buttons that control the background color of a label.
Java Source Code
This program evaluates postfix expressions entered by the user. The expressions can use non-negative real nubmers and the operators +,
Java Source Code
This is a Java Application program that supports two way real time chatting or communication between two users over the Internet. The program can be run either as a standalone application or as a client-server application.
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
Set up a Server that will receive packets from a client and send packets to a client. Also set up
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
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 short program demonstrates the URL and URLConnection classes by attempting to open a connection to a URL and read
Java Source Code