CPSC 233 Tutorial Session Introduction to Java and Eclipse Sepehr - - PowerPoint PPT Presentation

cpsc 233 tutorial session
SMART_READER_LITE
LIVE PREVIEW

CPSC 233 Tutorial Session Introduction to Java and Eclipse Sepehr - - PowerPoint PPT Presentation

CPSC 233 Tutorial Session Introduction to Java and Eclipse Sepehr Sabour 14, 16 January 2020 Who am I? My name is Sepehr Sabour I am a computer science master student You can find me at ICT720 Email: sepehr.sabour@ucalgary.ca


slide-1
SLIDE 1

CPSC 233 – Tutorial Session

Introduction to Java and Eclipse

Sepehr Sabour

14, 16 January 2020

slide-2
SLIDE 2

Who am I?

  • My name is Sepehr Sabour

I am a computer science master student

  • You can find me at ICT720
  • Email: sepehr.sabour@ucalgary.ca
  • Homepage: pesehr.github.io
  • Book and appointment: pesehr.youcanbook.me

2

slide-3
SLIDE 3

About CPSC 233

  • Learning Goals:
  • Object-oriented Programming (OOP)
  • Java Programming Language
  • Team programming
  • Activities:
  • Tutorials
  • Code Challenges (You need CPSC account)
  • Project (You need a team)

3

slide-4
SLIDE 4

What is Java

  • Java is a general-purpose object-oriented programming

language released on 1996.

  • Java is Compiler based language
  • Java codes run on the Java virtual machine (JVM)
  • We need Java Development Kit (JDK) to develop java programs
  • How to install:

https://java.com/en/download/help/download_options.xml

4

slide-5
SLIDE 5

Work with Linux Command Line

5

Purpose Command Example Move into a directory cd [directory address] cd Desktop Move back from a directory cd .. Jump to the home directory cd ~ List the contents of a directory ls Create a new directory mkdir [directory name] Mkdir MyFolder Create a new file touch [file name] touch MyFile.java Remove a file rm [file name] rm MyFile.java Copying a file cp [file name] [destination] cp MyFile.java Desktop Editing a file with gedit gedit [file name] gedit MyFile.java Compiling a java code javac[file name] javacMyFile.java Executing a compiled code java [compiled file] java MyFile

slide-6
SLIDE 6

Hello World!

  • Create a java file called Main.java
  • Add java skeleton into the file
  • Add the following line to the code:
  • Compile the code
  • Execute the compiled code

6

System.out.println("Hello World!");

slide-7
SLIDE 7

Java Code Skeleton

public class YouClassName{ public static void main(String args[]) { Youd code goes here! } }

7

slide-8
SLIDE 8

Eclipse IDE

  • Underlining of compile errors
  • Syntax highlighting
  • Code completion on typing
  • Easy .jar exporting
  • Managing files and packages

How to install Eclipse: https://www.eclipse.org/downloads/packages/installer

8

slide-9
SLIDE 9

Create a project in Eclipse

9