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

How can I run a C++ program directly from Windows?

How-can-I-run-a-C-program-directly-from-Windows