Vidyalelo
Java Programming · Q121

Constructors and Methods

Programming · Java Programming · question 121

Q121

What will be the output of the following Java code? class area int width; int length; int area; void area(int width, int length) this.width = width; this.length = length; class Output public static void main(String args[]) area obj = new area(); obj.area(5 , 6); System.out.println(obj.length + " " + obj.width);

A.
0 0
B.
5 6
C.
6 5
Answer
D.
5 5

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board