public enum Gender { MALE, FEMALE; private Gender() {} } public class customer { private int id; String firstname; Strin

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

public enum Gender { MALE, FEMALE; private Gender() {} } public class customer { private int id; String firstname; Strin

Post by answerhappygod »

public
enum Gender {
MALE,
FEMALE;
private Gender()
{}
}
public class customer
{
private int id;
String firstname;
String lastname;
string birthdate;
customer
c=new customer(int i,string fn,string ln
,string bd)
{
id=i;
firstname=fn;
lastname=ln;
birthdate=bd;
}
public void setid(int id1)
{ id=id1;
}
public void setfirstname(string firstname1)
{ firstname=firstname1;
}
public void setlastname(string lastname1)
{ lastname=lastname1;
}
public void setbirthdate(string birthdate1)
{ birthdate=birthdate1;
}
public int getage()
{ return id;
}
public string getfirstname()
{ return firstname;
}
public string getlastname()
{ return lastname;
}
public string getbirthdate()
{ return birthdate;
}
public static void main (String args[]);
{ customer c1=new customer(1,'abc','def','10-09-2013');
c1.setid(7);
c1.setfirstname('ghj');
c1.setlastname('iio');
c1.setbirthdate('10-03-2012');
Gender gender=new Gender(); // call constructor of enum
Gender
}
Question 2:
iiiiiii neeeeed Question
2 PLZZZZZZZZZZZZZZZZZZZZZZ ...................
Public Enum Gender Male Female Private Gender Public Class Customer Private Int Id String Firstname Strin 1
Public Enum Gender Male Female Private Gender Public Class Customer Private Int Id String Firstname Strin 1 (203.5 KiB) Viewed 70 times
Hierarchy BorderPane ToolBar OK Button Add Customer insert LEFT Add Customer ID: First Name: Last Name: GridPane (2 x 5) Label (0,0) ID: abe Label (0, 1) First Name: ab Label (0, 2) Last Name: A: Label (0,3) Gender Abe Label (0,4) Birth Date: TextField (1,0) TextField (1, 1) TextField (1,2) ComboBox (1,3) 9 DatePicker (1.4) insert RIGHT insert BOTTOM Gender Birth Date:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply