filmov
tv
Write a program to create a class Student and print Data method to display the data.calling class

Показать описание
Write a program to create a class Student with data ‘first name, Second name, Gender, city and age’ along with method print Data to display the data. Create the two objects s1 ,s2 to declare and access the values.
how to call method/Function in the class in java NetBeans with Example
How to create Object in Java NetBeans with Example
how to call class in java
Classes and Objects, Constructors in java NetBeans
I Write All java question in java NetBeans
#Java NetBeans, #Java, #C++,#NetBeans, Java Tutor
#Programming Code, #Java, #Programming,#Java Course
public class Student {
String FirstName;
String SecondName;
String Gender;
String city;
int age;
//this function is used to display all student data
void print(){
}
}
//create new class that have main method
class StudentMain {
public static void main(String [] args){
Student s1=new Student();//object :it used to call class student
Student s2=new Student();// this for other student or second student
//let us acsept input from user
}
}
how to call method/Function in the class in java NetBeans with Example
How to create Object in Java NetBeans with Example
how to call class in java
Classes and Objects, Constructors in java NetBeans
I Write All java question in java NetBeans
#Java NetBeans, #Java, #C++,#NetBeans, Java Tutor
#Programming Code, #Java, #Programming,#Java Course
public class Student {
String FirstName;
String SecondName;
String Gender;
String city;
int age;
//this function is used to display all student data
void print(){
}
}
//create new class that have main method
class StudentMain {
public static void main(String [] args){
Student s1=new Student();//object :it used to call class student
Student s2=new Student();// this for other student or second student
//let us acsept input from user
}
}