GRADE 12

JAVA MATERIAL FOR GRADE 12 STUDENTS

Gr 12 – OOP prelim practice

.Here is an OOP practical practice exercise called Big Claw Adventures. The solution requires 4 classes - a UI class, a manager class, a parent class and a child class  Follow the four steps. Answer the 14 questions. Mark your own work from the provided solutions....

read more

Gr 11 – Switch Case

Complex "if-then-else" statements are needed when there are many options e.g. consider all the options in a menu. Fortunately, there is a better way when a lot of options are needed i.e. the "Switch-Case-Break" construct. It works exactly the same as "if-else" but its...

read more

Gr 12 OOP theory prac notes

Here are Java OOP theory summary notes and Java OOP practical notes. These notes are not my own but were given to me by one of my students so I do not know who the original author is OOP theory OOP practical

read more

Gr 11, 12 – SQL tips

 SQL TIPS for exams. STUDY the database first (at least 5 full minutes). Study both the data and the fields. Know how many records are in each table so that you can recognize any potential errors in the returned dataset. The better you understand the database, the...

read more

Methods of Array class

Java has an "array" class that offers many useful methods that you can use in your grade 12 PAT. First you will need to import the Array class import java.util.Arrays; All the methods are static i.e. "Array.nameOfTheMethod". Here is a list of methods you mind find...

read more

Gr 11 – Write to text file

A Java program to write to a text file using PrintWriter (not FileWriter). This program reads in a text file using Scanner - a date and a boolean flag. It adds 45 days to the date and compliments the flag (true to false and false to true) It then writes the new data...

read more

The split method

Reading in a text file into an array of objects using the split( ) method in Java. (There are other ways of doing this for example using useDelimiter( ) with next( ) ) Here is the text file using "#" as the delimiter. Note that there are no extra spaces or strange...

read more

Java NetBeans 17

Java version 17 (JDK 17) is a LTS (Long Term Support version of Java). We use this version together with Apache NetBeans version 17. It is a good idea to uninstall any previous versions of Java and NetBeans using Windowns Control Panel, Uninstall software. Click here...

read more

PAT image problems

Your Java PAT project and image problems using NetBeans. JFrame Form. Images are too big. They are the wrong "shape" or size. Resizing your images. Aspect ratio. Background images. Images on action buttons. Layers. Layered pane. And finally when you run your...

read more