Created
April 20, 2011 15:36
-
-
Save scottfrazer/931673 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Derp | |
{ | |
public Derp() | |
{ | |
System.out.println("I get called when you do 'new Derp()'"); | |
} | |
private int herp(int x, int y) | |
{ | |
int q; | |
q = x+y; | |
return q; | |
} | |
public void foo() | |
{ | |
int x, y; | |
System.out.println("Enter "); | |
Scanner k = new Scanner(System.in); | |
x = k.nextInt(); | |
System.out.println("Enter y"); | |
y = k.nextInt(); | |
System.out.println("The sum of x and y is:" + this.herp(x,y)); | |
} | |
public static void main(String[] args) | |
{ | |
Derp derpObject = new Derp(); | |
derpObject.foo(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment