Programming – Lecture 15 Going Beyond the ACM Library.

Slides:



Advertisements
Similar presentations
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Advertisements

Lecture 4 More on Java® Data Types, Control Structures.
Loops –Do while Do While Reading for this Lecture, L&L, 5.7.
Computer Programming Lab(7).
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
Objects contains data and methods Class – type of object Create class first Then object or instance String – defined class String s; // creates instance.
Chapter 2 Programming by Example. A Holistic Perspective Three sections separated by blank lines. Program comment File: FileName.java
Fundamentals of Software Development 1Slide 1 Review: Why start with WordGames? You wrote your first lines of code in this course in WordGames.You wrote.
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
 To be able to write larger programs ◦ By breaking them down into smaller parts and passing data between the parts.  To understand the concepts of Methods.
Unit 2: Java Introduction to Programming 2.1 Initial Example.
1 BUILDING JAVA PROGRAMS CHAPTER 3 THE SCANNER CLASS AND USER INPUT.
Computer Programming Lab(5).
Applets  The Applet Class  The HTML Tag F Passing Parameters to Applets.
Fundamentals of Software Development 1Slide 1 Why start with WordGames? You wrote your first lines of code in this course in WordGames.You wrote your first.
Fundamentals of Software Development 1Slide 1 Recap: “From scratch” projects Today’s software engineering is almost NEVER “from scratch”Today’s software.
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
Java Fundamentals 3 Input and Output statements. Standard Output Window Using System.out, we can output multiple lines of text to the standard output.
Input & Output In Java. Input & Output It is very complicated for a computer to show how information is processed. Although a computer is very good at.
Interfaces. –An interface describes a set of methods: no constructors no instance variables –The interface must be implemented by some class. 646 java.
Input/Output in Java. Output To output to the command line, we use either System.out.print () or System.out.println() or System.out.printf() Examples.
Lecture 3 Decisions (Conditionals). One of the essential features of computer programs is their ability to make decisions. Like a train that changes tracks.
What’s New in Computer Science Education? A Report on the 2005 ACM/SIGCSE Meeting.
Can we talk?. In Hello World we already saw how to do Standard Output. You simply use the command line System.out.println(“text”); There are different.
A Simple Java Program //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) public static void main(String[]
Programming Fundamentals 2: Simple/ F II Objectives – –give some simple examples of Java applications and one applet 2. Simple Java.
CS100A, Fall 1997, Lecture 91 CS100A, Fall 1997 Lecture 9, Tuesday, 30 September Input/Output & Program Schema System.in, class Text, Some basic data processing,
 GUI – Graphic User Interface  Up to now in the programs we have written all output has been sent to the standard output device i.e.: the DOS console.
Java - Classes JPatterson. What is a class? public class _Alpha { public static void main(String [] args) { } You have been using classes all year – you.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
CHAPTER 5 GC 101 Input & Output 1. INTERACTIVE PROGRAMS  We have written programs that print console output, but it is also possible to read input from.
Lecture 4 – Scanner & Style. Console Output The console that starts a Java application is typically known as the standard output device. The standard.
Lab 01-2 Objectives:  Writing a Java program.  How to send output to the command line console.  Learn about escape sequences.  Learn how to compile,
Java and C++ Transitioning. A simple example public class HelloWorldApp { public static void main(String[] args) { //Display the string. System.out.println("Hello.
 CSC111 Quick Revision. Problem Write a java code that read a string, then show a list of options to the user to select from them, where:  L to print.
CS001 Introduction to Programming Day 6 Sujana Jyothi
import java.util.Scanner; class myCode { public static void main(String[] args) { Scanner input= new Scanner(System.in); int num1; System.out.println(“Enter.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Declaring console static and global import java.util.*; public class Test { static Scanner console = new Scanner (System.in); public static void main(String[]
Copyright 2008 by Pearson Education Building Java Programs Chapter 3 Lecture 3-3: Interactive Programs w/ Scanner reading: self-check: #16-19.
Lecture 7:Introduction to JavaFX Michael Hsu CSULA.
Introduction to programming in java
UFCFY5-30-1Multimedia Studio Coding for Interactive Media Fundamental Concepts.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
CLASSES IN JAVA Primitive Types Example of a Class Allocating Objects of a Class Protecting Class data Constructors Static data and Static Methods.
Java 5 Class Anatomy. User Defined Classes To this point we’ve been using classes that have been defined in the Java standard class library. Creating.
Lecture 7:Introduction to JavaFX Michael Hsu CSULA.
Java Methods and Applications CSIS 3701: Advanced Object Oriented Programming.
Lecture 4 – Scanner & Style
Introduction of Java Fikri Fadlillah, S.T.
CSC111 Quick Revision.
John Woodward A Simple Program – Hello world
CSC1401 Input and Output (and we’ll do a bit more on class creation)
Examples of Classes & Objects
Exercise Java programming
Lecture 7:Introduction to JavaFX
Chapter No. : 1 Introduction to Java.
Maha AlSaif Maryam AlQattan
March 29th Odds & Ends CS 239.
class PrintOnetoTen { public static void main(String args[]) {
Introduction to Java Brief history of Java Sample Java Program
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
Module 4 Loops and Repetition 4/7/2019 CSE 1321 Module 4.
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
The keyboard is the standard input device.
Developing Java Applications with NetBeans
Developing Java Applications with NetBeans
F II 2. Simple Java Programs Objectives
Computer Science Club 1st November 2019.
Presentation transcript:

Programming – Lecture 15 Going Beyond the ACM Library

The ACM Library So far, we have used the ACM library to write our programs. Most of our programs were instances of one of these classes: 2 ConsoleProgram DialogProgram GraphicsProgram Text-based Graphics-based

Alternatives 3 ConsoleProgram DialogProgram GraphicsProgram

Alternatives: Text-Based public class HelloWorld { public static void main (String[] args) { System.out.println("Hello World!"); } 4 Simple Java programs are text-based by default. Remember lecture 2:

Class Definition 5 ACM: public class Wubbel extends ConsoleProgram { //... } Java: No restrictions. Every class can have a main method.

Program Entry Point 6 ACM: public void run() { //... } Java: public static void main(String[] args) { //... }

Console Output 7 ACM: println(...); Java: System.out.println(...);

Console Input 8 ACM: String s = readLine(); int i = readInt(); Java: Scanner scanner = new Scanner( System.in); String s = scanner.next(); int i = scanner.nextInt();

Alternatives 9 ConsoleProgram DialogProgram GraphicsProgram

Java AWT 10 This is the original Java GUI library. Very outdated. You shouldn’t use this one.

Java Swing 11 The second Java GUI library. Quite flexible and different visual styles available. Can still be used, but has been superseded. Web resource: Creating a GUI With JFC/Swing

JavaFX 12 The current Java GUI library. Themeable, support for animations. This is a good choice for your applications. Web resource: Java Client Technologies