Java nprg013 labs
Download
1 / 9

Java ( NPRG013 ) Labs - PowerPoint PPT Presentation


  • 70 Views
  • Uploaded on

Java ( NPRG013 ) Labs. 2012/2013. Basic information. Course website http://d3s.mff.cuni.cz/~hnetynka/index.cgi/teaching/java “ Grupík ” module in SIS. Credit Conditions. Attendance ( max 3 absences ) Elsewise an extra homework One obligatory homework Fina l “project”

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Java ( NPRG013 ) Labs' - ivie


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Java nprg013 labs

Java(NPRG013) Labs

2012/2013

Jaroslav Keznikl, [email protected]


Basic information
Basic information

  • Course website

    • http://d3s.mff.cuni.cz/~hnetynka/index.cgi/teaching/java

  • “Grupík” module in SIS

Jaroslav Keznikl, [email protected]


Credit conditions
Credit Conditions

  • Attendance (max3 absences)

    • Elsewise an extra homework

  • One obligatory homework

  • Final “project”

    • Topic due at Nov. 14th 2012

    • Finalized preferably till the end of February

      • Hard deadline May 24th 2013 12:00(end of summer semester)

  • Final test

    Details on the course website

Jaroslav Keznikl, [email protected]


Guidelines
Guidelines

  • Basic Java info

    • package = a directory with a particular structure, containing source files

    • classpath = list of directories, where to look for packages

      • -cp, CLASSPATH environment variable

    • public static void main(String args) { … }

    • System.exit(intretval)

    • System.out.println(…)

      • print(…), printf(…)

Jaroslav Keznikl, [email protected]


Guidelines 2
Guidelines 2

  • Basicshell commands(bash, …)

    • man – manual pages

    • mkdir – create a directory

      • -p creates also the non-existing parent directories

    • cd – change directory

    • ls [-a, -l] – list directory contents

    • rm [-r-f] – delete a file/directory [recursively]

    • export CLASSPATH = “…”

      • Sets the CLASSPATH environment variable

  • Unix at MS

    • home vs home/BIG

      • cp –r .gnome BIG/.gnome

      • ln –s BIG/.gnome

  • Editor

    • vim/gvim, gedit (Gnome), kwrite (KDE), …

  • Java tools

    • java – runtime

    • javac – compiler

Jaroslav Keznikl, [email protected]


Guidelines 3
Guidelines 3

Basic procedure

// create a directory structure for the project & package

mkdir-p project/src/cz/cuni/mff/keznikl

// implement stuff

gvimproject/src/cz/cuni/mff/keznikl/Test.java

// compile (creates Test.class)

javacproject/src/cz/cuni/mff/keznikl/Test.java

// run it

java –cpproject/srccz.cuni.mff.Test

Implementation

packagecz.cuni.mff.keznikl;

publicclassTest {

publicstaticvoidmain(String[] args) { ... }

}

Jaroslav Keznikl, [email protected]


Assignment 1
Assignment 1

  • Program Hello World

    • Use your ownpackage(not the default=“” one)

Jaroslav Keznikl, [email protected]


Assignment 2
Assignment 2

  • An application that uses a class from a different project/package

  • 2 projects

    • hello, library

    • srcdirectory for source files

      • /…/home/…/projects/hello/src/

      • /…/home/…/projects/library/src/

  • Project library

    • package: org.company.library

    • contains class Printer

      • static method print(Stringmsg)

  • Project hello

    • package: cz.cuni.mff.example

    • method main

    • Prints “Hello world” using the Printerclass

Jaroslav Keznikl, [email protected]


Assignment 3 4
Assignment 3,4

  • Assignment 3

    • Create a program, which prints out all its arguments from the command line.

  • Assignment 4

    • Create a program, which prints out a multiplication table for numbers 1-10

Jaroslav Keznikl, [email protected]


ad