public class Disque { public static void main(String args[]) { int n i
public static int f(int x) {return(x+5) ; } ; public static int f(int x) public static void permuter (String s1 String s2
correct but it has a compilation error
yMax = maximum(y1y2
public interface Clone{ public static final Aventurier DJANGO_FETT = new Aventurier("Jango Fett"); public void tireSur(Personnage p); public void seDeplacer(int
public class Test { static Scanner input = new Scanner(System.in); public static void main (String[] args). {. // a et b sont les coordonnées du point.
C# import java.util.ArrayList; class Main { public static void main(String[] C# class Stuff { public static int x=7; public static void do_stuff() {.
public static void main (String args[]){. Chien f = new Chien("Fifi"); {public abstract void g(int); //erreur : nom d'argument obligatoire. } ...
tableau (réponse de type oui/non). class Exo6_6_1{ public static void main(String[] args){ int[] tab = {12 15
static int CETTE_ANNE = 2005; public LaDate (int j int m
public static int glob2 = 200;} // file #2 using System; public class TestGlobals Note that the Mainmethod the entry point to a C# application is static
The NET Framework common type system (CTS) defines how types are declared used and managed All native C# types are based upon the CTS to ensure support for cross-language integration Identifier developer defined token used to uniquely name a declared object or object instance Example: public class MyClassNameIdentifier { } Magic Number
int x y; public override string ToString() {return "x=" + x + "y=" + y;}}}}} class Circle : Shape {int r; public override string ToString() {return base ToString() + "r=" + r;}}}}} Classes and Structs base The base keyword is used to access class members that are hidden by similarly named members of the current class
9 Unified Type System Types Value Types Reference Types Pointers Simple Types Enums Structs Classes Interfaces Arrays Delegates bool char sbyte short
int x; int y;: static int count;}; In this example count is a public static member variable whose full name is Thing::count Even if it was private the constructor and destructor member functions can access it because they are member functions Because count is static it is a class-wide member variable not a member