class Demo {
public int value = 20;
Demo() {
value = 40;
}
3
public class Tester {
public static void main(String args[]) {
Demo demo new Demo ();
System.out.println(demo.value):
}}
output?
Answers
Answered by
0
Answer:
40
Explanation:
The constructor initializes the value to 40 when you create the object.
Similar questions
Hindi,
1 month ago
Math,
1 month ago
English,
1 month ago
Social Sciences,
2 months ago
English,
2 months ago
English,
9 months ago
Computer Science,
9 months ago