Sunday, March 4, 2018

Advance Java programming : A simple Java Bean Class

//This is simple bean class, containing only one property name with its getters and setters method.
//This class contains one extra method named displayInfo() that prints the student name by the hello message.

package com.ashutoshjava; 
 
public class Student { 
private String name; 
 
public String getName() { 
    return name; 
} 
 
public void setName(String name) { 
    this.name = name; 
} 
 
public void displayInfo(){ 
    System.out.println("Hello: "+name); 
} 

} 

Thanks,
Happy programming !

2 comments:

  1. Superb explaining.. i used it for recalling all essential concepts.. Really appreciate and love the work..thank you

    ReplyDelete
  2. Thanks for your positive and encouraging feedback.

    ReplyDelete

What is a superconductor?

 A superconductor is a material that can conduct electricity with zero electrical resistance when it is cooled below a specific, very cold t...