Part 1 โ€“ Fraction Class ๏‚ทDeclare two private integer instance variables to hold the numerator and denominator . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Part 1 โ€“ Fraction Class ๏‚ทDeclare two private integer instance variables to hold the numerator and denominator .

7th Nov 2019, 3:43 PM
Avilasha Trivedi
Avilasha Trivedi - avatar
2 Answers
+ 1
Well the access modifier is private. The datatype used is int. private int numer; private int denom;
7th Nov 2019, 3:47 PM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 1
public class Fraction{ private int numerator; private int denominator; } Is that all you are looking for?
7th Nov 2019, 4:02 PM
Avinesh
Avinesh - avatar