Program 6.4: An OOPTest that uses the print method

Outside the website method you call the print method just like you reference member variables, using the name of the object you want to print and the . separator as demonstrated ins Program 6.4.

class OOPTest {

  public static void main(String args[]) {
    website w = new website(); = "Cafe Au Lait";
    w.url = "";
    w.description = "Really cool!";

Copyright 1996 Elliotte Rusty Harold
This Chapter