Advertisement
aarono

'this' example

Mar 19th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.25 KB | None | 0 0
  1. public class SomeClass
  2. {
  3.     // Deklaration des Attributs
  4.     private int someNumber;
  5.  
  6.     // Konstruktor der Klasse
  7.     public SomeClass(int someNumber)
  8.     {
  9.         // Attribut- und Parametername identisch => Verwendung von 'this'
  10.         this.someNumber = someNumber
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement