
Explore how programming creates software that runs on personal computers and devices, and why there is no single best language for solving problems.
Explore how programming evolved from machine language to high-level languages, emphasizing compilers, data structures, and algorithms as tools to turn data into elegant software.
Explore computer basics, programs, and the World Wide Web with Java. Learn the Java language specification, API, JDK, and IDE; write, compile, and run a program in IntelliJ IDEA.
Explore the fundamental hardware and software of a computer, including the CPU, memory, storage, input/output, and communication devices, and how they work together to run programs.
Explore how binary, as 0s and 1s, powers computers through transistors, bits and bytes, and how ASCII maps characters like uppercase letters to binary values, with 8-bit and 16-bit representations.
After learning this course you will learn :
Machine Language
Assembly Language
High-level Language
What is an interpreter
What is a compiler
What is the difference between an interpreted language and a compiled language?
After learning this course you will be able to :
Understand the concept of Operation System
What are the major responsibilities of an operating system
What are multiprogramming, multithreading, and multiprocessing
Explore Java, a simple, object-oriented, portable language designed for web and standalone apps. It delivers the 'write once, run anywhere' promise across servers, desktops, and mobile devices.
After learning this course you will be able to answer these questions below:
What is the Java language specification?
What does JDK stand for?
What does IDE stand for?
Are tools like NetBeans and Eclipse different languages from Java, or are they dialects or extensions of Java?
Learn to write a simple Java program that prints 'Welcome to Java!' to the console, using a class with a main method and proper braces and semicolons.
After learning this course you will be able to answer these answers:
What is the Java source filename extension, and what is the Java bytecode filename extension?
What are the input and output of a Java compiler?
What is the command to compile a Java program?
What is the command to run a Java program?
What is the JVM?
Can Java run on any machine? What is needed to run Java on a computer?
If a NoClassDefFoundError occurs when you run a program, what is the cause of the error?
If a NoSuchMethodError occurs when you run a program, what is the cause of the error?
Create Welcome.java in a text editor, define a Welcome class with a main method that prints 'Welcome to Java!', save as Welcome.java, then compile with javac after installing the JDK.
After learning this course you will be able to :
Download JDK and install it on your computer (For me I use Mac version please choose the version fit your OS)
Use javac and java commands provided by the JDK to compile and run your Java program
After learning this course you will be able to understand what are:
Appropriate Comments and Comment Styles
Proper Indentation and Spacing
Block Styles
How to download Intellij IDEA
How to write your first Java program by using Intellij IDEA
What content you will learn after learning this chapter
How to user Intellij IDEA write a simple program to compute the area of the circle
You will learn how to Modify the code of previous course that read the user input from the Console.
What is Named Constant or Constant
The benefit of using Constant
What is the Java naming conventions
What is the benefit of following Java naming conventions
Numeric Types
Reading Numbers from the Keyboard
Numeric Operators
+
-
*
/
%
Exponent Operations
Integer Literals
Floating-Point Literals
Scientific Notation
Why are they called floating-point numbers?
precedence rule is used to determine the order of
evaluation
What is GMT
Write a program displaying the current time
What is Augmented Assignment Operators
Increment Operators
Decrement Operators
Postfix Operators
Prefix Operators
Explore numeric type conversions in Java, including explicit casting and widening from int to double. Learn how casting truncates fractions and may cause data loss when narrowing, using (type) value.
Software Development Process
Explore the software development process by building a loan payment calculator, detailing requirements specification, analysis, design, implementation, and testing while computing monthly payment and total payment from user inputs.
Explore case study in Java programming that converts a decimal dollar amount to cents and distributes it into dollars, quarters, dimes, nickels, and pennies to minimize coins.
Explore common Java programming errors, including undeclared or uninitialized variables, case sensitivity, and unused variables. Learn how integer overflow, rounding errors, unintended integer division, and redundant input objects disrupt programs.
Explore Java identifiers and primitive data types, learn naming rules, and apply arithmetic, assignment, and increment operators, then master type casting for widening and narrowing.
This chapter's Objectives
Validate radius input using if statements to handle negative values, display an error on the console, and run the normal workflow for positive values, while introducing relational operators.
Learn how the boolean data type stores true or false values and how to use comparison operators to evaluate expressions, including equality versus assignment.
Learn Java if statements and related constructs like if-else, switch, and conditional expressions, with braces usage demonstrated, through a user-input program that prints 'Hi five' or 'Hi even'.
Learn how two-way if-else statements control execution in Java by acting when conditions are true or false, with syntax and a flowchart example like radius is less than zero.
explains how nested if statements work and how to build multi-way if-else chains to select grades based on score, evaluating conditions in order.
Explore common errors and pitfalls in Java programming, including missing braces, stray semicolons, redundant boolean tests, incorrect equality vs assignment, dangling else, and code duplication.
Explore logical operators in Java, including not, and, or, and the exclusive logical operator, to build compound boolean expressions. Learn truth tables, precedence, and how parentheses clarify evaluation in code.
Explore how logical operators work in Java, using and, or, and not, with examples that compare x to zero, test equality, and evaluate true or false results.
Learn to determine leap years in Java using modulo checks and logical operators: divisible by 4 but not by 100, or divisible by 400, and test with 2008.
Generate two random single-digit integers in Java, swap if needed, then prompt the user to compute the difference and display whether the answer is correct.
Explore the switch statement in Java, replacing complex if-else chains with a clear switch syntax, including cases, default, and break, plus practical examples like tax, weekdays, and Chinese zodiac.
Explore how conditional expressions evaluate a condition to yield one of two expressions, enabling concise assignments like max of two numbers and one-line decisions in Java.
Explore operator precedence and associativity in Java, and learn how parentheses and evaluation order affect expressions, including logical, relation, and assignment operators.
Learn how debugging identifies and fixes syntax and runtime errors using prints and a debugger. Use breakpoints, stepping, and variable displays to verify fixes.
Use the integrated debugger to set breakpoints, step over and into code, and inspect variables to diagnose a division by zero error in a Java program.
Learn core loop concepts in Java by using while and for statements, and create nested loops. Apply break and continue, handle sentinel values, and print prime numbers.
Understand the motivation for loops in Java, see how a while loop repeats 'Welcome to Java' a hundred times, and learn the three loop types: while, do while, and for.
Explore the while loop, loop body, and counter-controlled iterations, where a boolean loop continuation condition determines execution and prevents infinite loops, with a Welcome to Java example.
Rewrite a program to repeatedly prompt for the sum of two digits using a while loop until the answer is correct, then display 'you got it!'
Explains how the do-while loop executes the body before checking the condition, contrasts it with the while loop, and demonstrates a user-input sum example.
Learn the Java for loop syntax, including initialization, loop condition, and post-iteration actions, with control variable scope and examples that avoid infinite loops.
Choose among for, while, and do-while loops by understanding pre-test and post-test evaluation and the equivalence of loop forms, and select the most intuitive option.
demonstrate how nested loops use an outer loop and an inner loop to generate and display a multiplication table on the terminal.
Learn how break and continue control loop execution in Java: break terminates the loop when the sum reaches 100, while continue skips iterations like 10 and 11.
Learn to write a Java program that checks if a string is a palindrome by comparing characters from both ends with a while loop, scanner input, and a palindrome flag.
Master Java methods: define and invoke with formal and actual parameters; support return values or void, explore ambiguous overloading, implement hexadecimal to decimal conversion, and apply method abstraction, stepwise refinement.
Define and invoke a sum method with two parameters to compute series like 1-10, 20-30, and 35-45, reusing common code through method abstraction.
Define a method by specifying modifiers, return type, name, and parameters, and implement its body; distinguish between void and value returning methods and understand the method signature.
Define and call a static max method in Java, pass parameters, and handle return values or void, then invoke it from another class to reuse code.
Explore the method call stack, activation frames, and activation records as the runtime stack grows with method invocations and returns, illustrated by a main, A, B, and C example.
Explore void methods that do not return a value, and how to define and invoke them, contrasted with returning methods like getGrade that produce a value using return.
Explore how arguments are passed by value in Java, ensuring order and type compatibility, and see how methods like increment and swap affect variables on the call stack.
Define max methods with the same name but different parameters to compare int and double values. Learn how the compiler chooses the best match and avoids ambiguous invocations.
Explore variable scope in Java, focusing on local variable lifetimes within blocks and loops, and how inner blocks create separate scopes and name conflicts.
This chapter covers single-dimensional arrays in Java, including declare and initialize, display, sum, min and max, copy contents, for-each loops, pass arguments to main, and binary search and selection sort.
Learn how to declare, create, and initialize single-dimension arrays in Java with the new operator, access elements using 0-based indices, and iterate with for loops using length.
Learn to process arrays in Java using for loops to initialize, display, sum, find the maximum, and shuffle or reverse elements, with user input and random values.
Learn how to traverse an array with a for-each loop and compare it to the traditional for loop, highlighting its limitations for reversing order and modifying elements.
Explore how to write a Java program that reads numbers with a scanner, stores them in an array, computes the sum and average, and counts values above the average.
Explore how to copy arrays in Java, noting that assignment copies references, not contents, and that unreachable references are garbage collected. Learn three methods: loop copy, System.arraycopy, and clone method.
Explain how arrays are passed to methods in Java: pass by value versus pass by reference, how references affect original arrays, and why swaps inside methods behave differently.
Learn how to return an array from a method and pass an array as a parameter by reversing it with a result array and returning it.
Understand how to declare a variable-length argument list in Java with a last-parameter varargs, and see how the printMax method computes the maximum from those values in an array.
Explore the linear search approach in Java, and learn how to scan an array sequentially, compare each element to a target, and return the index or -1 if not found.
discover how binary search finds a target in a sorted array by repeatedly halving the search range with middle-element comparisons, and compare its efficiency to linear search.
Explore how the Arrays class in Java enables sorting arrays, performing binary searches, comparing arrays with equals, and using copy, fill, and toString methods to display results.
Learn how to pass command line arguments to the Java main method via the args array, print them with a for loop, and handle spaces with quotes.
Define a calculator program that reads three arguments: a first integer, an operator, and a second integer, and computes the result using a switch on the operator.
Explore declaring and accessing two-dimensional and multi-dimensional arrays with row and column indexes, perform display, sum, min, max, and shuffle operations, and build grading question programs.
Learn to declare, create, and access elements in two dimensional arrays (matrices) in Java, using row and column indices, with initialization examples and a distance table.
Explore processing two-dimensional arrays in Java by initializing with user input or random values, printing matrices, and computing row totals and the maximum-sum row.
Explore passing a two dimensional array to a method, returning a 2D array, and calculating the sum of elements from a user entered 3x4 matrix, shown with a 78 total.
Write a Java program that grades a ten-question multiple-choice test for eight students by comparing a 2d answers array to a 1d key and displaying each student’s score.
Solve the geometric problem of finding the two nearest points by reading points, computing distances, and tracking the closest pair indices.
Define classes as blueprints for objects, detailing their state with data fields and their behavior with methods, including constructors for initialization.
Define a circle class with radius, provide default and parameterized constructors, and implement get area, get perimeter, and set radius; instantiate objects in a test class.
Model a TV as a class with channel, volume, and power state; implement a public constructor and methods to turn on/off, set channel, channel up/down, and volume up/down, test objects.
Learn how constructors create objects with the new operator, sharing the class name and having no return type, including implicit default constructors when none are defined.
Learn how reference variables refer to objects using reference types in Java, access object data with the dot operator, and distinguish instance and class methods.
Explore how reference data fields behave, including default null values for reference types, and explain why local strings must be initialized before use in methods.
Explore differences between primitive and reference types in Java, compare value versus reference semantics, and explain how assignments share or duplicate data and how garbage collection frees unused objects.
Explore how static variables share data across all objects, contrast with instance fields, and use static methods to access class data, including counting objects.
Explore visibility modifiers in Java, including public, default (package-private), and private, and learn how these modifiers control access. Private restricts access to its own class.
enforce data field encapsulation by declaring fields private, expose values through getters and setters to prevent tampering, validate radius and object count, and improve maintainability of the circle class.
Explore how Java passes objects to methods by value, via object references. See how primitive values differ, while object references can alter the original circle through a called method.
Explore immutable objects and classes in Java, defining immutable classes with private fields and no mutators, and avoiding returning references to mutable data, illustrated by a dateCreated example.
Explore how the this keyword references the object itself and enables invoking another constructor, while also linking to instance fields and parameters.
Explore class abstraction and encapsulation in Java by comparing procedural and object-oriented approaches, defining classes, creating objects, and enforcing a class contract with public members while hiding implementation.
Explore association in class design, with UML representations of student, course, and faculty relationships, multiplicities, and the roles of aggregation and composition in Java using lists and add methods.
Explore aggregation as a has-a ownership relationship in Java, where an aggregating class owns an aggregated object, such as a student with an address or a person with a supervisor.
Explore object oriented design by building a Java course class with a name, a students array, and addStudent, dropStudent, and getStudent method, plus a TestCourse demo.
Design a Java integer stack with push, pop, peek, isEmpty, and size methods, implementing dynamic capacity resizing to accommodate growth.
Wrap primitive values into objects with wrapper classes, and explore numeric wrappers like integer and double, including max/min values and parsing strings in binary, octal, decimal, and hexadecimal.
Explain boxing and unboxing between primitive types and wrapper classes, showing how the compiler automatically boxes and unboxes values, with examples using integers and wrapper classes.
Learn how big integer and big decimal handle numbers of any size in Java, perform immutable operations, and see a factorial example using big integers with rounding for non-terminating divisions.
Explore the Java string class, its immutability, and constructors. Learn to replace, split, and match with regular expressions, and convert between strings and char arrays, plus formatting.
Learn how StringBuilder and StringBuffer provide mutable alternatives to strings, using append, insert, replace, reverse, and capacity management, with synchronization for thread safety.
Filter non alphanumeric characters from the input, build a cleaned string, and reverse it. Compare the cleaned string to its reverse to check for palindrome patterns in the case study.
Understand inheritance with a geometric object superclass and circle and rectangle subclasses, and implement constructors, getters, setters, and area and perimeter calculations.
Model is-a relationship using inheritance; a subclass is not a subset and can add data while private superclass data remains inaccessible. Use single inheritance in Java; interfaces enable broader behavior.
Learn how to use the super keyword to invoke superclass constructors and methods, always as the first statement in a subclass constructor, with and without arguments.
Explore the super keyword and constructor chaining, where a subclass constructor calls its superclass constructor before executing its own tasks, and understand no-argument constructors and default constructors to avoid errors.
Learn how a subclass overrides a superclass method, such as toString in a circle, using super to access the implementation, while noting accessibility, return type compatibility, and static method limits.
Explain how overriding provides a new implementation for a superclass method in a subclass, and how overloading defines same-name methods with different parameter types and the override annotation.
Explain the Object class as the root of all classes, show how the default toString prints the class name and memory address, and demonstrate overriding toString for meaningful object representations.
Explore polymorphism in object-oriented programming by showing how a subclass inherits from a superclass and can be used wherever a superclass is expected, with circles and rectangles.
Dynamic binding selects the correct method at runtime by using the declared type and the actual type, traversing the class hierarchy to find the overridden implementation.
Explore casting objects in Java, including upcasting to a superclass and downcasting to a subclass, and use the instanceof operator to prevent runtime class cast exceptions.
Explore polymorphism and casting in Java by passing circle and rectangle objects to a display method, using instance of checks and automatic casting, and contrast with primitive casting.
Explain how the object's equals method works to compare by reference and by content, and show overriding equals in a circle class to compare radii.
Introduces the ArrayList class for storing objects with generics, demonstrates adding, removing, and querying size, contains, indexOf, isEmpty, and inserting at an index, with forward and reverse iteration.
Explore how to use the ArrayList class to collect integers from user input until zero, avoid duplicates with contains, and display elements with for or for-each loops, contrasting with arrays.
Learn key Java list operations: create string arrays, sort elements with the Collections.sort method, find max and min values, and shuffle elements. See practical examples and API usage.
Java programming tutorial teaches designing a stack class for holding objects, implementing methods such as isEmpty, size, peek, pop, push, and search, with a test demonstrating usage.
Explore how private, protected, default, and public modifiers govern access to data fields and methods across classes, packages, and subclasses, including when to use protected access.
Learn how the final modifier prevents extension and method overriding in Java, as shown with a final maths class and final methods that cannot be overridden by subclasses.
Java is a great programming language. In the turbulent development of computer technology, Java is everywhere and extremely powerful.
In 1995, Java Applet enabled Web pages to deliver exciting and interactive multimedia content, which facilitating the Web flourishing.
Then with the development of the Web, the Web application became the mainstream way of developing large-scale application.
Java relied on "Compile once, run everywhere" feature to support the cross-platform capabilities which is required by Internet applications and becomes the mainstream language for server-side development.Java EE is still the most important enterprise development platform of the server-side.
Now we are in the era of mobile Internet, and Java is still the deserved leading programming language.
Applications such as Android development, cloud computing, big data, the Internet of Things, and wearable devices all require a distributed computing environment that can be cross-platform and cross-device. We will still see the key role of the Java programming language.
Java is a classic object-oriented programming language with elegant and concise syntax and a rich and useful class library which allows programmers to focus as much as possible on problem solving in the business world.
Many open source projects and prototype systems in research are implemented in Java. The language is so widely used ,it will directly help students in their future research and work. This tutorial has a comprehensive knowledge, clear architecture, a large selection of examples and a large number of well-designed exercises.
This tutorial takes a foundation-first approach, starting with the basics of programming, gradually introducing object-oriented thinking, and finally introducing the application framework, which is very suitable for students who are getting started with programming.
In addition, the emphasis on problem-oriented teaching methods is the key feature of this tutorial, which is the teaching method I have been following in this course.
The best way to teach programming is by example , and the only way to learn programming is by doing .
Teaching students to learn programming courses through vivid and practical examples, avoid boring grammar learning which allowing students to apply what they have learned.
The most important part of the programming course is to develop students' computational thinking. Mastering the thinking of programming, you can easily learn and use other programming languages.
Finally, I wish everyone a happy study.