_ 4 Which of the following is the default value of a local variable? A - null B-
ID: 3590137 • Letter: #
Question
Explanation / Answer
Ans 4 - ->c, it depends upon the type of the variable.If the variable is of integer type then it will be having default value 0 if string type the null if float then 0.0 and so on.
Ans 5--> b, The protected access specfier allows u access the protected memebers and constructors to be accessed in the same package as well as to the subclasses which inherits the class in which protected members were declared.
3rd option i.e c is wrong becoz here it is said that protected members are only accessible to the child classes. But as we knw it is accessible to the classes of same pacakge hence it was a wrong option.
Ans 6--> c ,The string is not a primary data type as the primary data types are the most basic data types such as char ,int float etc whereas string is the advancement of char data type with some more memory as string is tge the collection of characters.
Ans 7-->a, the output will be Hello again!! .
As we all knw that execution of a program starts through main function...so going to main it first created a object of the cls and the called the function onemethod(). So the output is Hello again!!.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.