« Back
package com.string; class Employee{ int emp_Id; String emp_Name; public Employee (int id, String name) { emp_Id = id; emp_Name = name; } @Override public String toString() { return "Employee [emp_Id=" + emp_Id + ", emp_Name=" + emp_Name + "]"; } } public class ToString { public static void main(String args[]) { Employee e = new Employee(1,"Ankit"); System.out.println(e); } }
Employee [emp_Id=1, emp_Name=Ankit]
×
Report a Problem:
Description:
Submit