June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
17
Task/Classes/Processing/classes-1
Normal file
17
Task/Classes/Processing/classes-1
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class ProgrammingLanguage
|
||||
{
|
||||
// instance variable:
|
||||
private String name;
|
||||
// constructor (let's use it to give the instance variable a value):
|
||||
public ProgrammingLanguage(String name)
|
||||
{
|
||||
this.name = name;
|
||||
// note use of "this" to distinguish the instance variable from the argument
|
||||
}
|
||||
// a method:
|
||||
public void sayHello()
|
||||
{
|
||||
println("Hello from the programming language " + name);
|
||||
// the method has no argument or local variable called "name", so we can omit the "this"
|
||||
}
|
||||
}
|
||||
5
Task/Classes/Processing/classes-2
Normal file
5
Task/Classes/Processing/classes-2
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// instantiate the class:
|
||||
ProgrammingLanguage processing = new ProgrammingLanguage("Processing");
|
||||
|
||||
// call the method:
|
||||
processing.sayHello();
|
||||
Loading…
Add table
Add a link
Reference in a new issue