Pu Wenjiang java Seventh jobs

Question 1

5 on the basis of the job, and then creating a column type, comprising a rectangle, and the high volume of the three member variables,

A constructor for a member variable initialization, and the volume is calculated, for the bottom two functional means, the input in the main category length, width, height, calculated cylinder volume,

Enter the new length, width, height, creating a new rectangle, the method using soled soled, the cylinder volume is calculated again.

Question 2

MyInteger design class name, which includes: int type value a data field construction method, when the specified int value, creating MyInteger objects, the data field value and the access modifier isEven () and isOdd () method,

If the current object is even or odd, it returns true, the method based isPrime (MyInteger i), determines whether the value of the specified object is created in the main category MyInteger a prime number, returns true,, each class verification methods MyInteger

Guess you like

Origin www.cnblogs.com/papapa613/p/11567347.html