Fraction game code in java
I'm only starting to learn and code in Java programming language. I have conquered simple programming constructs like branching and looping constructs, but I am having troubles with coding a simple game with a Fraction class.
Here's what I've come up with so far:
package test;
public class Fraction {long denominator;long numeratorpublic Fraction(long pnumerator, long pdenominator) {this.numerator = pnumerator;this.denominator = pdenominator;}public long getNumerator() {return numerator;}public long getDenominator() {return denominator;}}
prog.java:1: error: ‘package’ does not name a typeprog.java:3: error: expected unqualified-id before ‘public’