• Nie Znaleziono Wyników

Eclipse, JAVA

N/A
N/A
Protected

Academic year: 2021

Share "Eclipse, JAVA"

Copied!
2
0
0

Pełen tekst

(1)

DPOB LI0 Object programming - classes 8

This document contains information about laboratory exercises.

Object programming - classes 8

Subjects - Introduction to Java Programming.

1. First JAVA program.

1. Find and run Eclipse platform.

2. Set path to your workspace.

3. Create new Java Project and write Hello world program.

4. Run command line and go to folder where you save your project. Using javac compiler create .class files. Check your version of JAVA compiler.

5. Run file ∗.class using JAVA virtual machine java.

6. Import to existing project all files for today laboratories.

2. Basics of java

Analize file J avaCodeStyle.java and its methods, pay attention to:

1. Loops : f orLoop(), breakAndContinue(). Change the loop ’for’ to while and do...while.

2. Condition : test(), test2(). Write code of method test3 that do the same as test and test2 using operator ? :

3. Arrays : T ablice.java. Check what is the warning about?

4. Logic type bool : bool(). Where class Random came from ?

Differences between Java and C++:

1. Variable passing Ref erencje.java, 2. Assign P rzypisz.java,

3. Comparing P orownaj.java,

Inheritance:

1. Analize the program Dziedziczenie.java

Encapsulation:

1. Create new package pakiet.

2. Inside package pakiet implement class A with attributes public, protected, private and without any access level modifier.

3. Create class B that will inherit form A and check to what fields you have access ?.

4. Create another class that inherit from A and put it in another package than A. What fields could you use know ?

1

(2)

DPOB LI0 Object programming - classes 8

3. Do it yourself tasks

1. Write a program that read command line arguments and write in order form longest to shortest and give its length.

2. Documentation page Documenatation. Page with tutorials tutorials.

2

Cytaty

Powiązane dokumenty

Free trial available

Free trial available

In this article We present (1) short description of the data structures in contemporary Database Systems, (2) the advantages and the disadvantages of the two common types which

This PhD thesis includes a careful study of the last two problems, i.e., how to reduce the test-data burden for monster chips, and how to create a design-for-testability

Napisz program, który dla podanych jako argumenty programu nazwisk wpisze je do tablicy nazwisk, a następnie wypisze na je w kolejności od najdłuższego na ekran podając dla

(b) Complete the following truth table, relating to the statement made in part (a), and decide whether the statement is logically valid.. p: Jones passed this course q: Smith

A satellite travels around the Earth in a circular orbit 500 kilometres above the Earth’s surface.. The radius of the Earth is taken as

And, of course, you should be able to countTheOranges (which returns the number of oranges on the tree), and pickAnOrange (which reduces the @orangeCount by one