Java Programming Language Java Constructor and Methods
⚠ Report Question ✓ Question Verified
class Test{ public int display(int x, int y){ return ("The sum of x and y is " + x + y); } public static void main(String args[]){ Test test = new Test(); System.out.println(test.display(4,5)); } }
Learn More MCQ Questions from Java Programming Language Java Constructor and Methods
Evaluate your understanding of Java constructors and methods with these multiple choice questions. Learn about the different types of constructors and methods in Java and how to use them in your programs. Take the quiz now!