Introduction to Computers and Java (Condensed
Notes)
2.1 Basic Computer Terminology
• Computer – programmable machine performing tasks like spreadsheets, games, etc.
• Program (software) – list of instructions directing computer tasks.
• Hardware – physical components (keyboard, mouse, printer, etc.).
• Software – programs running on computer.
• Computer System – combination of hardware and software.
• CPU – heart of computer; performs fetch–decode–execute cycle.
• CPU parts: Control Unit (coordinates operations), ALU (math & logic).
• Memory (RAM) – volatile, stores current data/programs; divided into bytes (8 bits each).
• Each byte has an address; 1=on, 0=off.
• Secondary Storage – non-volatile (CD, SSD, USB).
• Input Devices – keyboard, mouse, drives, camera, touchscreen.
• Output Devices – monitor, printer, storage drives.
• Software types – Operating Systems (manage hardware) & Application Software (user tasks).
• Operating Systems examples – Windows, Mac OS, Linux, UNIX.
• Application Software – Word, Excel, games, accounting tools.
2.2 Programming Languages
• Programming languages simplify communication with computers (words vs. numbers).
• Programs written in high-level languages → translated to machine language by compilers.
• Common Languages:
• • BASIC – easy for beginners.
• • FORTRAN – scientific/mathematical computing.
• • COBOL – business applications.
• • Pascal – teaching programming.
• • C – structured, general-purpose.
• • C++ – adds object-oriented features.
• • C# – Microsoft’s .NET language.
• • Java – object-oriented, cross-platform (‘write once, run anywhere’).
• • JavaScript – web scripting, not related to Java.
• • Python – object-oriented, popular in web & academia.
• • PHP, Ruby, Perl, Visual Basic – used for web/dev environments.
2.3 Introduction to Java
• Developed by Sun Microsystems (1991) by James Gosling; owned by Oracle.
• Java 1.0 released in 1995; Java 17 (2021 LTS); Java 20 (2023 latest).
• WORA principle – ‘Write Once, Run Anywhere’.
• Basic elements of Java program:
• • Keywords – reserved words (e.g., public, class, static, void).
• • Operators – symbols performing operations.
• • Punctuation – marks statement boundaries (e.g., ;, {}).
• • Identifiers – programmer-defined names (variables, functions).
• • Syntax – rules for structure and formatting.
• Example:
• int hours = 40; double payRate = 25.0; grossPay = hours * payRate;
• System.out.println("Your gross pay is $" + grossPay);
• Compiler translates .java → .class (bytecode).
• Bytecode runs on JVM (Java Virtual Machine) – interpreted language.
• Java Development Kit (JDK):
• • Java SE – standard apps.
• • Java EE – enterprise/web apps.
• • Java ME – small devices (phones, appliances).
• Common IDEs – IntelliJ IDEA, Eclipse, NetBeans, Android Studio.
• Students @uwo.ca get free JetBrains Ultimate license.