2. a) What is the role of default and protected access modifier in Java? b) What happens when a class with parameterized constructors and having no default constructor is used in a program and we...


this is a java question complete 2 and provide right information and don't copy from internet please


2. a) What is the role of default and protected access modifier in Java?<br>b) What happens when a class with parameterized constructors and having no default constructor<br>is used in a program and we create an object that needs a zero-argument constructor?<br>c) Find out the error of the following Java code. How do you fix the error?<br>public class Test {<br>public static void main(String[] args) {<br>int x = getvalue();<br>System.out.println(x);<br>}<br>public static getvalue() {<br>return 10;<br>}<br>}<br>

Extracted text: 2. a) What is the role of default and protected access modifier in Java? b) What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor? c) Find out the error of the following Java code. How do you fix the error? public class Test { public static void main(String[] args) { int x = getvalue(); System.out.println(x); } public static getvalue() { return 10; } }

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here