Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

13. Given the deelantion _ publie class My-Class private int x publie vold print

ID: 3726601 • Letter: 1

Question

13. Given the deelantion _ publie class My-Class private int x publie vold printo MyClass aa-new MyClesso The following statement is legal. aa-printO 14. The built-in operation that is valid for classes is the dot operstor 15. The 16. The method toString is used to conevert an object to a String object 17. You cannot override the default definition of the method toString because it is provided by Jsva. 18 The modifier static in the heading specines that the method can be invoked by using the name of the class. 19. When no object of the class type is instantiated static data members of the class fail to exist. copy constructor executes when an object is instantiated and iniktialized using an existing object -20. The method finalize automatically executes when the class object goes out of scope. 21. An accessor method of a class first accesses the values of the data members of the class and then changes the values of the data members 22. You can import your classes in the same way that you import classes from the packages provided by Java 23. Every object has access to a reference to itself 24. In Java, the reference this is used to refer to only the instance variables not the methods of a class. 25. Classes that are defined within other classes are called nested classes. 26· The abstract data type specifies the logical properties without the implementation details. 27. Method overloading is when two or more methods of the same class have the same name but differ 28. In a static method, you may use the this parameter either explicitly or implicitly. 29. The String class is a mutable class. 30. To use a package, the program must contain an import statement that names the package 31. Inner and outer classes do not have access to each other's private members. or types of parameters.

Explanation / Answer



13.
public class Myclass
{
private int x;
public void print()
{
System.out.println("x="+x);
}
}
Myclass as=new Myclass();
The Following statement is legal.?
as.print();
Answer: yes,true.The following Statement is Legal,here Created That class using New Keyword,new keyword is used to allocate memory at run time. All objects get memory in Heap memory area.
By default The Constructor will automatically invoke when we create an object for a particular class.No Need to Create Constructor Again.
So We can call the method that is inside the class.
  
  
14.The Built-in Operation that is valid for classes is the dot Operator.
Answer:true.
Actually Class Members either variables,methods Objects can be Accessed/call by using the Dot operator.
15.The Copy Constructor can be Executes when an Object is Instantiated and initialized using an Existing Class.
Answer:true
16.The Method tostring() is used to Convert the Objects into Strings.
Answer:True.
We can use toString() method to get string representation of an object.
17 You Cannot override the default definition of the method toString because it is provided by java.
Answer:False
If we did not define toString() method in our class
then Object class toString() method is invoked otherwise our implemented/Overridden toString() method will be called.
18.The Modifier Static in the heading specifies that the method can be invoked by using the name of the class.
Answer:true.
19.when No Object of the class type is instantiated static data members of the class is fail to exist.
Answer:False
Static Data Members(variables) are only used in Static Methods that are restrict to use in non-static Methods.
And Static Method can be called without creating an instance of a particular class.
20.The Method finalize() Automatically executes,when the class object can be goes out of the Scope.
Answer:True.
The java.lang.Object.finalize() is called by the garbage collector on an object when garbage collection determines that there are no more references to the object

21.An Accessor Method of class first accesses the values of the data members of the class and then changes the values of the data members.
Answer:True
An Accessor method is commonly known as a get method or simply a getter. A property of the object is returned by the accessor method.
So First it Access the data and then changes that according to our Requirement.

22.You can import your classes in the same way that you import classes from the packages provided by the Java.
Answer:True
23.Every Object has Access to a reference to itself
Answer:True

24.In Java the reference This Keyword is used to refer to only the instance variables but not the methods of class.

Answer:False
Actually this is used to refer the current class Object.
But also this can be used to invoke current class method (implicitly),to return the current class instance from the method.


25.Classes that are defined within the other classes are called nested classes.

Answer:True

26.The Abstract data type specifies the logical properties without the implementation Details.

Answer:True

27.Method Overloading is when two or more methods of the same class have the same name but different Types of Arguments
Answer:true

28.In a Static Method you may use this implicitly/Explicitly

Answer:False
In Static Method This Keyword cannot be used.
29.The String Class is mutable
Answer:False
The String is a Immutable.
30.To use a Package ,the program must contain an import statement that names the Package.
Answer:True

31.Inner and Outer classes do not have access to each other's private members.
Answer:False



Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote