Home » » Class and Object in Java Program

Class and Object in Java Program

Class and Object in Java Program

Class and Object in Java Program

Class and Object

import java.io.*;
class ajith
{
public string name;
public int age;
void getdata() throws IOException
{
DataInputStream in=new DataInputStream(System.in);
{
System.out.println("Enter the name and age is:");
name=in.readLine();
age=Integer.parseInt(in.readLine());
}
}
void putdata()
{
System.out.println("The given name is:"name);
System.out.println("The given age is:"+age);
}
}
class selva
{
public Static void main(String args[]) throws IOException
{
ajith a=new ajith();
a.getdata();
a.putdata();
}
}


0 coment�rios:

Post a Comment

Link you don't want to vouch for Read more: https://html.com/seo/#ixzz5zVltiZ5g