Which Of The Following Options Can Be A Possible Output Of The #599
Which of the following options can be a possible output of the Java code mentioned below?</p> <pre><code class="language-java"> class FormDetails { int id; String name; String tag; Details(int id, String name, String tag) { this.id=id; this.name=name; this.tag=tag; } public static void main(String args[]) { Details obj1=new Details(1,"Pawan","NoTag"); Details obj2=new Details(2,"Mahesh","NoTag"); System.out.println(obj1); System.out.println(obj2); } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs111 OOP Object Oriented Programming Java. It can also be found in gs gs111 Types of Classes (Using Java) - Object Class - Quiz No.1.
Which of the following options can be a possible output of the Java code mentioned below?
class FormDetails { int id; String name; String tag; Details(int id, String name, String tag) { this.id=id; this.name=name; this.tag=tag; } public static void main(String args[]) { Details obj1=new Details(1,"Pawan","NoTag"); Details obj2=new Details(2,"Mahesh","NoTag"); System.out.println(obj1); System.out.println(obj2); } }
1 Pawan NoTag 2 Mahesh NoTag
1,"Pawan","NoTag" 2,"Mahesh","NoTag"
Details@15db9742 Details@6d06d69c
obj1@15db9742 obj2@6d06d69c