Lecture 1: Welcome to 61B

8/26/2020

Hello World

# In Python print("hello world") // In Java public class HelloWorld { public static void main(String[] args) { System.out.println("hello world"); } } // Output: hello world
# In Python x = 0 while x < 10: print(x) x = x + 1 // In Java public class HelloNumbers { public static void main(String[] args) { int x = 0; // Must declare variables, variable types can never change while (x < 10) { System.out.println(x); x = x + 1; } } }
# In Python def larger(x, y): """Returns the larger of x and y""" if (x > y): return x return y print (larger(-5, 10)) // In Java public class LargerDemo { /** Returns the larger of x and y. */ public static larger(int x, int y) { if (x > y) { return x; } return y; } public static void main(String[] args) { System.out.println(larger(-5, 10)); } }

Java and Object Orientation

Java and Static Typing

Reflections on Static Typing

Welcome to 61B 2019

What is 61B About?

Why Study Algorithms or Data Structures?

Why Study Algorithms or Data Structures?

Why Study Algorithms or Data Structures?