Tag: Science
17
items with this tag.
- AP Computer Science Oct 13, 2026 AP Computer Science Junior Year · California Crosspoint Academy Java course notes, reviewed for code syntax and technical accuracy.
- Arrays Oct 13, 2026 Arrays Define an array of size n int[] myArray = new int[n]; An array has a fixed length.
- Commenting Oct 13, 2026 Commenting Single-line comments (rems) Text after // is a comment until the end of that line.
- Conditionals and Equality Oct 13, 2026 Conditionals and Equality If–else Schematic syntax: if (condition1) { body1 } else if (condition2) { body2 } else { body3 } Braces can be omitted for a single controlled statement, but using them helps avoid ambiguity.
- Introduction to Java Oct 13, 2026 Introduction to Java Hello World public class Main { public static void main(String[] args) { System.out.println("Hello World"); } } Classes Classes are blueprints for objects: they describe information and behavior.
- Logic Oct 13, 2026 Logic Logical operators NameMeaningJava symbolShort-circuit behaviorEqualityCompare primitive values, or object references==NoneAndBoth operands are true&&If the left operand is false, skip the right operandOrAt least one operand is true||If the left operand is true, skip the right operandNe...
- Loops Oct 13, 2026 Loops For loop Schematic syntax: for (initialization; condition; update) { body } Syntax correction The three parts are separated by semicolons, rather than the commas in the original example.
- Methods Oct 13, 2026 Methods Definition This method prints Hi! and returns 0: public int hello() { System.out.println("Hi!"); return 0; } It belongs inside a class.
- Number Systems Oct 13, 2026 Number Systems Base 10: decimal Digits: 0 through 9. This is the familiar mathematical notation and the usual notation for integer literals in Java.
- Object-Oriented Programming Oct 13, 2026 Object-Oriented Programming Classes A class defines a type of object: a set of information (fields) and behaviors (methods).
- Random Numbers Oct 13, 2026 Random Numbers Math.random() Returns a pseudorandom double in [0.0, 1.0), using a shared random-number generator internally.
- Recursion Oct 13, 2026 Recursion A method calls itself to derive a solution to a problem. Solving a recursive problem Find the base cases.
- Scanner Oct 13, 2026 Scanner Scanner is a class in java.util, commonly used to read user input.
- Strings and Characters Oct 13, 2026 Strings and Characters String and char A double-quoted literal is a string; a single-quoted literal is a character.
- Time Complexity Oct 13, 2026 Time Complexity Big O notation describes an asymptotic upper bound on how an algorithm’s work grows with input size n.
- Type Casting Oct 13, 2026 Type Casting Widening conversions Common widening paths are: byte → short → int → long → float → double char → int → long → float → double Correction to the original notes There is no widening step short → char.
- Variables Oct 13, 2026 Variables Declaration and initialization int x = 0; Schematic syntax: type name = initialValue;.