Whether you are here to learn Java for fun or for the AP Exam, there are several vocabulary terms that all computer scientists need to know. Computer Science jargon may sound complicated, but rest assured, after reading this article, you will be able to understand the fundamentals of programming.
Vocab: Given that the AP Exam doesn't contain multiple-choice questions, these vocab terms only cover the bare essentials to understand the language.
Class Files - a file that stores bytecode(computer code processed by the JVM)
Compiler - it turns computer language into machine code
Console - the computer display and keyboard which allows you to communicate
Debugger - its job is to detect and correct errors
Editor - a software program built to edit/type
Executing - starting/testing a program
Garbage Collector - deletes no longer used data
High-Level Programming - many translations to machine code; easy but slow
IDE(Integrated Development Environment) - includes debugger, editor, and compiler (ex. IntelliJ)
Java File - a file that uses the Java language
Memory leak - program that doesn't release memory after use
Object-Oriented Programming - customizable, extendable data (inheritable)
Program - set of commands written in programming language to do a task
Whew, that was a lot! But that's the biggest chunk of vocab terms that you need to know; the rest will be a breeze. You got this!
Types of errors:
Syntax/Compile error - compilation error, caught before execution (ex. missing semicolon)
Runtime Error - error causes running program to crash (ex. dividing by 0)
Logic Error - an error which produces the incorrect output (ex. 9+10=21)
With the vocab out of the way, let's start on basic Java principles/syntax:
Comments:
// - single line comment
/**/ - multi-line comment
Escape Sequences (used within print statement):
\" - makes a single apostrophe
\\ - makes a \
\t - makes a tab
\n - makes a new line
Skeleton code:
public class MainFile //this is the class header/declaration
{
public static void main(String[] args) //this is a basic method declaration
{
//enter code here
}
}
Print Statements (println makes prints the statement on a new line while print makes it on the same line):
System.out.println("enter text here");
System.out.print("enter text here");
Basic Examples:
public class MainFile
{
public static void main(String[] args)
{
System.out.println("Hello"); //output = Hello
}
}
public class MainFile
{
public static void main(String[] args)
{
System.out.println("\"\\//\""); // output = "\//"
}
}
public class MainFile
{
public static void main(String[] args)
{
System.out.println("Dark\tness"); //output = Dark ness
}
}
I hope it helps; Happy Coding/cramming!
Comments