Howdy. 

Adrian German

dgerman@indiana.edu

C212/A592 Introduction to Software Systems

http://www.cs.indiana.edu/classes/c212

http://www.cs.indiana.edu/classes/c212-dgerman/fall2015/syllabus.pdf

Let's write a simple Java program. 

Java programs are made out of classes. 

Classes are containers. They contain members. 

Members are: procedures and variables. 

Members can be static and non-static. 

One static member is special: the main method. It's used to start/run the program. 

class One {
  public static void main(String[] args) {
    System.out.println("Howdy."); 
    System.out.println("Howdy."); 
    System.out.println("Howdy."); 
  }
}

Here's what this does: 

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run One
Howdy.
Howdy.
Howdy.


Here's a different program: 

class One {
  public static void main(String[] args) {
    System.out.print("Howdy."); 
    System.out.print("Howdy."); 
    System.out.print("Howdy."); 
  }
}

Here's how this one runs: 

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run One
Howdy.Howdy.Howdy.> 

We will discuss operators:

class One {
  public static void main(String[] args) {
    System.out.println( 3 / 2 ); // prints 1 (why?)
  }
}

Here's another program:

import javax.swing.JFrame; 

class One {
  public static void main(String[] args) {
    JFrame f = new JFrame();
    f.setVisible(true); 
    f.setSize(300, 500); 
    System.out.println( f ); 
  }
}

This prints:

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run One
javax.swing.JFrame[frame0,0,0,300x500,invalid,layout=java.awt.BorderLayout,title=,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,8,31,124x0,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]


But it also looks like: 

(I'll post a picture here)

Now we should start reading the book. 

--