Which statement is true about the given code? public class Test78 { public static void main(String[] args) throws Exception { new JBean().setHeight(1).setWidth(2).setDepth(3).setDensity(9); } } class JBean { private int height, width, depth, density; public JBean setHeight (int h) { this.height = h; return this; } public JBean setWidth (int w) { this.width = w; return this; } public JBean setDepth (int d) { this.depth = d; return this; } public JBean setDensity (int d) { this.density = d; return this; } }
Correct Answer:
The code compiles and runs.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Java MCQ Questions