Java 8

1 Intro #

The CIS department at Brooklyn College officially supports Java 8. This means that Java courses are taught adhering to this version. Using later versions such as Java 11 is perfectly find for most instances, there may be some minor differences with certain classes and methods or certain version specific-quirks.

The best thing to do is to keep documentation links handy.

These are useful links to reference.

The Java Tutorials for JDK 8 #

https://docs.oracle.com/javase/tutorial/index.html

Java SE 8 Documenatation #

https://docs.oracle.com/javase/8/

Java SE 8 API #

https://docs.oracle.com/javase/8/docs/api/index.html

Java Code Visualizer #

http://www.pythontutor.com/java.html#mode=edit

Concepts #

  • Variables
  • Primitive Data Types
  • Operators
  • Expressions, Statements, and Blocks
  • Control Flow Statements
  • Objects & Classes
  • Arrays

2 Compiling Java on Command Line #

To compile Java source code on the command line, it is with this command where Main.java is your filename.

javac Main.java

followed by running the executable generated with

java Main

2.1 BC Students can use the WEB Lab Server to compile and run Java code #

Use a terminal friendly app to connect to the server via ssh. A sample command is as follows:

ssh username@hostname

After entering your password, create a directory for your assignment, such as mkdir folder1 and then you can use a command line such as vim, emacs, or nano to edit the file.

2.1.1 You can get your linux server account information from the W.E.B. Computing lab #

You can email the Linux Administrator, Raymond Patitucci or visit their locatio nat

First floor, West End Building P: 718.951.5787

3 Java Books and other resources #

3.0.1 Teach Yourself Java in 21 Minutes #

https://fileadmin.cs.lth.se/cs/Education/EDA040/common/java21.pdf

3.0.2 Java4Kids #

https://yfain.github.io/Java4Kids/

4 Lecture Slides #

  • Java Review

  • Two Dimensional Arrays