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

Sacred Thought

5 May 2024 Hari Om Verse 50-51, chapter two:  In this chapter two Shree krishna explains a simple way of living. Free from desires and void ...