Download presentation
Presentation is loading. Please wait.
1
Java Overview February 4, 2004
2
2/4/2004 Assignments Due – Homework 1 Due – Reading and Warmup questions Project 1 – Basic Networking
3
2/4/2004 Hello.java public class Hello { public static void main(String[] args) { //display a greeting in the console window System.out.println(“Hello, World!”); } }
4
2/4/2004 What is an object? Instance of a class Basic entity manipulated in a Java program Program is made of multiple objects interacting Ex. – coffee machine – Coins, Cups, ??? Behavior – methods called on objects Classes define the behavior
5
2/4/2004 BankAccount.java http://www.nmsl.cs.ucsb.edu/~srollins/courses/cs5-m02/web/code/71/BankAccount.java http://www.nmsl.cs.ucsb.edu/~srollins/courses/cs5-m02/web/code/71/BankAccountTest.java
6
2/4/2004 Threads Lightweight process Would like to be able to do “two things at once” Create a thread to do each thing
7
2/4/2004 Threads Example // Construct an object to process the HTTP request message. HttpRequest request = new HttpRequest(connectionSocket); // Create a new thread to process the request. Thread thread = new Thread(request); // Start the thread. thread.start(); class HttpRequest implements Runnable // Implement the run() method of the Runnable interface. public void run()
8
2/4/2004 Graphical User Interface UIExample.java
9
2/4/2004 Other Helpful Hints
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.