0% found this document useful (0 votes)
81 views

A Program in Java To Create A Class Customer Having Three Attributes Name PDF

Uploaded by

TeenuJoseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

A Program in Java To Create A Class Customer Having Three Attributes Name PDF

Uploaded by

TeenuJoseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

/* A program in Java to create a class customer having three attributes name, bill and id.

Include appropriate methods for taking input from customer and displaying its values*/

import java.io.DataInputStream;
class Customer
{
public static void main(String arg[])
{
DataInputStream myinput=new DataInputStream(System.in);
String name;
int bill = 0,id = 0;
try
{
System.out.println("enter name of customer");
name = myinput.readLine();

System.out.println("enter bill");
bill = Integer.parseInt(myinput.readLine());

System.out.println("enter id");
id = Integer.parseInt(myinput.readLine());

System.out.println ("name of customer is"+name);


System.out.println ("bill of customer"+bill);
System.out.println ("id of customer"+id);
}
catch(Exception e)
{
System.out.println("wrong input error!!!");
}
}
}
Copyright © BCA Notes All Rights Reserved.

You might also like