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

When I compile and run it does this:

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


Now I would like to try to explore another class:

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> import javax.swing.JFrame;
> JFrame a = new JFrame();
> a
javax.swing.JFrame[frame0,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,title=,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,0x0,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
> a.setVisible(true); 
> a.setSize(200, 300); 
> a.setSize(400, 300);


So that's the JFrame. 

The fundamental unit of compilation in Java is the package.

A package is just a folder. 

If you don't explicitly create a package you are in fact 
working with the default package which is simply the current
directory you're in. 

The only package whose classes are imported by default is
java.lang and System is a class in that package. String, Math
are classes in that package. 

Minute paper: write an expression to 

  (a) calculate square root of 2

  (b) calculate logarith base 10 of 237486

   What's the meaning of the answe in this case?

  (c) raise 2.7128 to the power of 3.142592 

Here's the answer to the first question:

public class Monday {
  public static void main(String[] args) {
    System.out.println( Math.sqrt(2) ); 
  }
}

I am asking about the use of new with a class in general. 

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> String a = "something"; 
> a.charAt(4)
't'
> a.substring(4)
"thing"
> a.substring(4, 8)
"thin"
> a = new String("nothing")
"nothing"
> a
"nothing"

  
What does it mean when I say Math.sqrt(...)

What does it mean when I say System.out.println(...)

What does it mean when I say System.out

Here's an experiment

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

Here's what it gives us

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run Monday
java.io.PrintStream@5ca034e7


System.out and Math.sqrt(...) refer to static members in
Sstem and Math. One is a variable (out) the other one is a
procedure (sqrt). 

public class System {
  public static void main(String[] args) {
    java.lang.System.out.println("My name is Fatih."); 
  }
}

So now 

public class Monday {
  public static void main(String[] args) {
    System.out.println( "see you!" ); // System.out ); 
  }
}

public class System {
  static PrintWriter out = new PrintWriter();
  public static void main(String[] args) {
    java.lang.System.out.println("My name is Fatih."); 
  }
}

public class PrintWriter {
  public void println(String something) {
    java.lang.System.out.println("I don't want to print: " + something); 
  }
}

Here's how this runs:

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run Monday
I don't want to print: see you!


--