Stanford CS106A - Programming Methodology (Java Basics)
Cards in this deck
(23 cards)Preview terms and definitions before starting your study session.
main method in a Java program?main method is the entry point for any standalone Java application. When you run a Java program, the JVM looks for and executes the main method first. Its signature is public static void main(String[] args).int age;.2. Initialization: Assigns an initial value to a declared variable, e.g.,
age = 30;.Often, declaration and initialization are combined:
int age = 30;.int: Stores whole numbers (integers), e.g., 10, -5.2.
double: Stores floating-point numbers (decimals), e.g., 3.14, -0.5.3.
boolean: Stores truth values, either true or false.4.
char: Stores a single character, enclosed in single quotes, e.g., 'A', '7'.String data type differ from primitive data types in Java?String is an object (a class), not a primitive data type. It represents a sequence of characters. Unlike primitives which store direct values, String variables store references to String objects in memory.if statement in Java?if statement executes a block of code only if a specified condition is true.if (condition) {
// Code to execute if condition is true
}if-else if-else statement.true condition's block is executed, and subsequent else if and else blocks are skipped.if (condition1) {
// Code for condition1
} else if (condition2) {
// Code for condition2
} else {
// Code if no conditions above are true
}for loop in Java? Provide its basic syntax.for loop is ideal when you know exactly how many times you want to iterate, often used for iterating over arrays or a fixed range of numbers.for (initialization; condition; increment/decrement) {
// Code to execute repeatedly
}Related Flashcard Sets
Explore similar study materials created by the community
Korean TOPIK I - Essential Vocabulary & Grammar (Levels 1-2)
Master essential Korean vocabulary and grammar for the TOPIK I exam! This deck covers Hangeul, greetings, numbers, basic verbs, particles, and sentence structures to build your foundational Korean fluency.
TypeScript - Advanced Types, Interfaces & Generics
Master TypeScript's advanced features with this comprehensive flashcard deck! Dive deep into generics, complex type manipulations like mapped and conditional types, and robust type guards to build highly scalable and maintainable applications.
Organic Chemistry Mechanisms - SN1/SN2 & E1/E2 Reactions
Master the core of organic reactions! Unravel the intricate electron-pushing mechanisms of SN1, SN2, E1, and E2 reactions, understanding their kinetics, stereochemistry, and the factors that dictate product outcomes.
Cisco CCNA (200-301) - Enterprise Networking & IP Services
Master enterprise networking and IP services for the Cisco CCNA (200-301) exam with this high-yield flashcard deck. Dive deep into TCP/IP, subnetting, routing, VLANs, STP, NAT, and essential Cisco IOS commands to solidify your certification knowledge.