
120 Cal.App.2d 807 (1953)
ALEXANDER M. MARSHALL, Appellant,
v.
WILLIAM W. VON ZUMWALT et al., Respondents.
Civ. No. 19574. 
California Court of Appeals. Second Dist., Div. Two.  
Oct. 26, 1953.
 Sidney L. Gelber for Appellant.
 Kates & Tannen for Respondents.
 McCOMB, J.
 From a judgment in favor of defendants after trial before the court without a jury in an action to recover (1) $1,400 loaned to defendants, and (2) $100 for the reasonable value of work, labor and services performed for defendant William Von Zumwalt, plaintiff appeals.
 Viewing the testimony most favorable to defendants (respondents) the record discloses that defendant Von Zumwalt agreed to construct a house for plaintiff and plaintiff's wife; plaintiff advanced to defendant money to purchase two lots, one for plaintiff's home and one for defendant's home; plaintiff further worked on his own home in accordance with an agreement whereby defendant would not pay him with cash, but would credit him with the value of his work toward the price of his home or extras ordered.
 Subsequently plaintiff's home was constructed by defendant and plaintiff was charged with extras in the sum of $2,113.09, against which was credited the sum of $1,400 and $100.
 The trial court found that plaintiff did lend to defendant the sum of $1,400 and plaintiff performed work, labor and services for defendant in the reasonable value of $100, and further found that such sums were paid by defendant's crediting plaintiff with such amounts against extras ordered by plaintiff during construction of his home.
 When plaintiff rested, the court, on defendant's motion, dismissed defendant's cross-complaint predicated upon the contract to build a house for plaintiff.
 Thereafter defendant introduced testimony showing that he had credited plaintiff with $1,500 against a sum in excess thereof which plaintiff owed defendant for constructing a house for him.
 Questions: First: Did the trial court err in admitting in evidence testimony concerning a building contract, under the terms of which plaintiff owed defendant in excess of $1,500 and against which defendant had credited plaintiff with the sum of $1,500 alleged to be due plaintiff in the complaint in the present action, for the reason there was no evidence that defendant was a duly licensed contractor?
 No. [1] Section 7031 of the Business and Professions Code of California reads as follows: "No person in the business or acting in the capacity of a contractor, may bring or *810 maintain any action in any court of this State for the collection of compensation for the performance of any act or contract for which a license is required by this chapter without alleging and proving that he was a duly licensed contractor at all times during the performance of such act or contract." (Italics added.)
 It is to be noted that the statute merely prohibits a contractor from maintaining or bringing an action upon a contract which he has entered into pertaining to the contracting business. It does not prohibit him when sued from setting up as a defense any sums which may be equitably due him from the plaintiff upon such illegal contract. Such a contract is not malum in se but merely malum prohibitum.
 [2] The applicable rule is thus stated in 12 American Jurisprudence (1938), Contracts, section 158, page 654, as follows: "Contracts made in violation of statutes, if not malum in se, are sometimes held valid, and generally so, notwithstanding the infraction of law, whenever it becomes necessary to save from injury persons for whose protection the violated statutes were enacted or whenever the public interests require that such contracts shall be enforced."
 [3] It is clear that equity and justice require that plaintiff be charged for the benefits which he has received from defendant and defendant be credited with the value of services and materials which he has furnished to plaintiff. There is no question of public interest or public policy involved in the instant case. It is purely a matter of balancing the rights and equities between the parties.
 Second: Did the trial court err in denying plaintiff's motion to strike defendant's exhibits and testimony concerning the building contract between the parties, for the reason that the same was new matter and not admissible under defendant's general denial of the allegations of plaintiff's causes of action?
 No. [4] It is not necessary to plead payment specifically in an answer. Evidence of payment may be shown under a general denial of the allegations of the complaint. (Snodgrass v. Snodgrass, 81 Cal.App. 360, 363 [2] [235 P. 755].) In the instant case defendant generally denied in his answer the essential allegations of plaintiff's complaint. Therefore the foregoing rule is applicable.
 [5] Third: Did the trial court commit prejudicial error in permitting defendant during the trial to amend his answer to conform to the proof by alleging that plaintiff had been paid any sums due him? *811
 No, for two reasons: (1) As set forth in answer to question Second, supra, such evidence was admissible without any pleading, therefore plaintiff was not prejudiced by the amendment and any error in it must be disregarded by the court under the provisions of article VI, section 4 1/2 of the Constitution of the State of California; [6] (2) The rule is settled that amendments to pleadings rest in the sound discretion of the trial court whose ruling will not be disturbed in the absence of a showing of abuse of discretion. (Fetterley v. Gibson, 210 Cal. 282, 283 [3] [291 P. 411].) In the instant case there is no showing that the trial court abused its discretion.
 Affirmed.
 Moore, P. J., and Fox, J., concurred.
