hogeschool / INFDEV02-3

Statically typed, polymorphic object oriented programming course at Hogeschool Rotterdam
MIT License
11 stars 14 forks source link

Fout pagina 103 (INFDEV02_3_Lec1_OO_intro) #8

Open rubenev opened 8 years ago

rubenev commented 8 years ago

1 class MyClass { 2 static public int f( int x ) { 3 return (x + 10) ; 4 } 5 }

busal commented 8 years ago

Zie paragraaf 8.3.1 field modifiers

https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.3.1

busal commented 8 years ago

and 8.4.3 method modifiers

https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.3

YouriTjang commented 8 years ago

Should be: public static instead of static public

busal commented 8 years ago

public and static are both field and method modifiers that have no order. So,

public static myMethod...

and

static public myMethod ...

are both syntactically correct. See links before

YouriTjang commented 8 years ago

I propose we'd consider it a bug if we structurally demonstrate code that goes against the customs and usual practices of the field.

Wiejeben commented 8 years ago

+1

busal commented 8 years ago

It's not a bug and I know it is commonly used in the form:

public static

So an extra opportunity to get attention of what we are actually writing or just copy from 'others'...:-)