Introduction to
Computer Science
By: Prince Emmanuel Ndoinjeh
Objectives
Understand what computer science is and why it matters
Learn about the AP Computer Science A course and exam format
Get familiar with Java as a programming language
Set up development tools and understand the structure of a Java program
BlueCrest Liberia 2
What is Computer Science?
Computer science is the study of what computers can do and how humans
can use them to solve problems.
Not just programming — programming is the tool, not the goal
Core concepts:
• Logic – reasoning through problems and decisions
• Algorithms – step-by-step instructions to solve problems
• Data structures – how we store and manage data
• Problem-solving – applying logical thinking and creativity to real issues
BlueCrest Liberia 3
The Problem-Solving Nature of CS
CS teaches how to break big problems into smaller ones — this skill applies
far beyond tech.
Examples of real-world problems solved with CS:
Finding the shortest route in a map app
Detecting fraudulent transactions
Managing large online shopping inventories
Personalizing video recommendations
BlueCrest Liberia 4
Real-World Applications of Computer Science
Area Example Applications
Software Development Apps, websites, games, business systems
Data Science Analyzing trends (COVID-19, sports, finance)
Artificial Intelligence Chatbots, facial recognition, self-driving cars
Cybersecurity Protecting systems and user privacy
Robotics Industrial automation, drones, space tech
Healthcare Predictive diagnosis, patient data management
Education Online learning platforms, AI tutors
BlueCrest Liberia 5
Careers in Computer Science
Introduce a few key roles:
Software Developer – build applications or systems
Data Analyst / Data Scientist – interpret data to solve business problems
Cybersecurity Specialist – protect digital infrastructure
Machine Learning Engineer – build intelligent systems
Web / Mobile Developer – design websites and apps
Game Developer – create video games
Computer Science Educator – teach the next generation
📈 According to the U.S. Bureau of Labor Statistics, jobs in CS-related fields are among the
fastest-growing and best-paid globally.
BlueCrest Liberia 6
Why Java?
Think of Computer Science as the art of solving problems. A programming
language like Java is the tool — the paintbrush — we use to bring those
solutions to life on the canvas of the computer.
There are many programming languages out there, each with different
strengths. In this course — and on the AP Computer Science A exam —
we’ll use Java, a powerful and widely-used language that teaches great
habits and scales to solve real-world problems.
BlueCrest Liberia 7
History and Use of Java
“Write once, run anywhere" — Java was designed for portability and flexibility.
Brief History
Created in 1995 by James Gosling at Sun Microsystems
Initially used in embedded devices and web browsers
Now powers enterprise software, Android apps, financial systems, and more
Common Uses Today
Android apps (Java was the primary language for Android for years)
Back-end web development (used in enterprise systems)
Big data tools (like Hadoop)
Banking and financial applications
AP Computer Science A Exam – The official language of the curriculum
BlueCrest Liberia 8
Java vs Other Languages
Language Strengths Comparison to Java
Python Easy syntax, beginner-friendly Java is more verbose but stricter
High performance, control over Java is safer (automatic memory
C++
memory mgmt)
Java runs on servers/devices, not
JavaScript Web development
browsers
Swift iOS/macOS apps Java is platform-independent
Java is strongly typed, object-oriented, and compiled — ideal for teaching good coding discipline.
BlueCrest Liberia 9
Java Syntax Basics
Here’s a simple "Hello, World" program in Java:
public class HelloWorld {
public static void main(String[] args) {
[Link]("Hello, world!");
}
}
Key Parts:
• public class HelloWorld – Every Java program starts with a class
• public static void main(String[] args) – The entry point
• [Link](...) – Used to print output
BlueCrest Liberia 10
Java Syntax Features to Know Early:
Semicolons (;) end most lines
Curly braces ({}) define code blocks
Case-sensitive (e.g., Main ≠ main)
Strong typing (variables must have a defined type)
Feature Java Example
Variable int age = 16;
String String name = "Alice";
Conditionals if (age > 18) { ... }
Loop for (int i = 0; i < 5; i++)
BlueCrest Liberia 11
Why Java for Students?
Teaches problem-solving and logic
Encourages good structure and style
Prepares students for university-level CS and real-world development
Used in AP CS A, making it directly relevant
BlueCrest Liberia 12
Tools & Environment Setup
What is an IDE?
An Integrated Development Environment (IDE) is a software application that helps you write,
run, and debug code.
Key features:
Code editor
Compiler/interpreter
Debugging tools
Output window
BlueCrest Liberia 13
Recommended IDE Options for Students
IDE / Platform Pros Ideal For
Web-based, no install needed,
[Link] (Replit) Beginners, Chromebook users
easy sharing
Designed for education, great
BlueJ AP CS A students
for OOP
Eclipse Powerful, customizable Intermediate/Advanced users
Industry standard, smart
IntelliJ IDEA Advanced/College-level users
features
Recommendation: Start with [Link] for fast onboarding, or BlueJ for a more AP-CS-A-friendly experience.
BlueCrest Liberia 14
Installing or Accessing an IDE
Option A: [Link] (Online)
Go to [Link]
Create an account
Start a new Repl → Choose Java → Name your project
You’re ready to code in your browser!
Option B: BlueJ (Offline)
Download from [Link]
Install the Java Development Kit (JDK) if prompted
Run BlueJ, create a new project
Add a new class → [Link]
BlueCrest Liberia 15
Writing Your First Java Program
public class HelloWorld {
public static void main(String[] args) {
[Link]("Hello, world!");
}
}
Explanation:
public class HelloWorld → Defines a class (Java’s basic structure)
public static void main(String[] args) → Entry point of the program
[Link](...) → Prints output to the console
Every curly brace {} must be matched — Java is strict with structure!
BlueCrest Liberia 16
Activity: Try It Yourself
Write a program that prints your name, age, and your favorite food or hobby.
public class AboutMe {
public static void main(String[] args) {
[Link]("My name is Prince.");
[Link]("I am 17 years old.");
[Link]("I love playing chess.");
}
}
BlueCrest Liberia 17
Java Program Structure
Breakdown:
public class HelloWorld:
Every program is a class (Java is object-oriented!)
The file name must match the class name ([Link])
main method:
This is where the program starts running
Required for any program that runs directly
Key rules:
Every opening { must have a closing }
Statements end with a semicolon ;
Java is case-sensitive (Main ≠ main)
BlueCrest Liberia 18
Compilation vs. Interpretation
Aspect Compilation (Java) Interpretation (e.g., Python)
Code Type Compiled into bytecode (.class) Executed line by line
Tool Java Compiler (javac) Python interpreter (python)
Performance Generally faster at runtime Slower, more flexible
Debugging Errors caught before running Errors caught during execution
Java Flow:
[Link] Java code in .java file
[Link] it → javac [Link] [Link], BlueJ, or Eclipse hides steps 2 and 3
behind the scenes, but they still happen!
[Link] it → java HelloWorld
BlueCrest Liberia 19
How to Read Java Error Messages
Common Errors & What They Mean:
Error Message Likely Cause
';' expected You missed a semicolon at the end of a line
cannot find symbol Typo in variable/class/method name
class HelloWorld is public... File name doesn’t match class name
unclosed string literal Missing closing quotation mark in a string
illegal start of expression Syntax error or misplaced bracket
public class HelloWorld {
[Link]: error: ';' expected
public static void main(String[] args) {
[Link]("Hello, world!")
[Link]("Hello, world!") // <- MISSING
^
SEMICOLON!
}
}
BlueCrest Liberia 20
Concept of Data in Programming
A program is just a set of instructions to process data. But what is
data, and how do we organize it?
If you were designing a program to run a calculator or quiz app,
what kinds of information would it need to store?
Numbers (ages, grades)
Text (names, messages)
True/false (did the user log in?)
Date Your Footer Here 21
What is Data?
Data is any piece of information that a computer can process.
In programming, data can be:
A number (like your age or test score)
A word or sentence (like your name or a password)
A true/false value (like whether a user is logged in)
Date Your Footer Here 22
Why Do We Store Data?
Just like humans, computers need memory to remember information while
working.
Real-World Analogy:
Imagine a calculator that:
•Asks for two numbers
•Remembers them
•Then calculates and shows the result
To do this, it needs to store those numbers somewhere. That’s where variables come in —
containers to hold data while your program runs.
Date Your Footer Here 23
What is a Variable?
A variable is like a labeled box that stores a piece of data.
int age = 17;
int → the type of data
age → the name of the variable
17 → the value stored
Date Your Footer Here 24
Types of Data in Programming (Java)
Primitive Types (basic building blocks)
Type Example Description
int int score = 90; Whole numbers
double double gpa = 3.75; Decimal numbers
boolean boolean isOnline = true; True or false
A single character (letter,
char char grade = 'A';
digit)
Date Your Footer Here 25
Types of Data in Programming (Java)
Object Types (more complex, built from primitives)
Type Example Description
A sequence of characters
String String name = "Alice";
(words, sentences)
Others ArrayList, Scanner, etc. Introduced in later lessons
Date Your Footer Here 26
Type Casting in Java
What is Type Casting?
Type casting means converting one data type into another.
Why it matters:
Sometimes we need to convert between types to perform the correct
operations or avoid errors.
Date Your Footer Here 27
Type Casting in Java
Two Types of Casting
Widening Casting (Automatic — safe)
int x = 5;
double y = x; // int to double is safe
Narrowing Casting (Manual — may lose data)
double a = 9.7;
int b = (int) a; // b = 9 (decimal part is cut off)
Date Your Footer Here 28
Static Methods in Java
What is a Static Method?
A static method belongs to a class — you can use it without creating an object.
Common Example: Math Class
double root = [Link](25); // 5.0
int maxVal = [Link](10, 20); // 20
double result = [Link](2, 3); // 8.0
You don’t need to do: Math m = new Math();
Just call: [Link](...)
Date Your Footer Here 29
Prince Emmanuel Ndoinjeh
+231555169548
Bluecrest Liberia
Thank You!
Semester 8
BlueCrest Liberia 30