Skip to content

Assignment_3 Added#3

Open
Naman1109 wants to merge 1 commit intomainfrom
Assignment_3
Open

Assignment_3 Added#3
Naman1109 wants to merge 1 commit intomainfrom
Assignment_3

Conversation

@Naman1109
Copy link
Owner

Assignment_3 Added.

Copy link

@yashwantdhakad yashwantdhakad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few minor suggestions

class Employee implements Serializable {

String Name;
String Email_Address;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable name should be lower camel case.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sir

Scanner sc = new Scanner(System.in);

System.out.println("Pkease Enter Name..!");
String Name = sc.nextLine();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here please use lower camel case for variable name.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sir

while (litr.hasNext()) {
Employee emp = (Employee) litr.next();
if (emp.Name.equals(Name)) {
System.out.println(emp);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If employ found then you can break this loop

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok sir

while (litr.hasNext()) {
Employee emp = (Employee) litr.next();
if (emp.Name.equals(Name)) {
litr.remove();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If employ found you can break this loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants