CSC300: Python to Java: Fully qualified class names [29/40] Previous pageContentsNext page

PythonJava
01
print ("Hello")
01
02
03
04
05
06
package algs11;
public class Hello {
  public static void main (java.lang.String[] args) {
    stdlib.StdOut.println ("Hello");
  }
}

As an alternative to using import, you can also use a class's fully qualified name, which includes the package explicitly.

Fully qualified names make code rather verbose, so usually people prefer to use import.

Previous pageContentsNext page