javascript
Brief description  about Online courses   join in Online courses
View Akshay Arun Fadte 's Profile

sir help me with error

class Name {

int name = 1;
int age = 0;

void name (int value) {
int name = value;
}

void age (int Value) {
int age = Value;
}


void FirstPrintstate ( ) {
System.out.println ("My name is " name);
System.out.println ("My my age is " age);
}
}


class MyCar {

public static void main(String[] args) {
Name Myname1 = new Name( );
Name Myname2 = new Name( );


Myname1.name(akshay);
Myname2.age(19);
myName2.firstPrintstate( );

}
}
Asked by Akshay Arun Fadte | Jan 2, 2014 |  Reply now
Replies (1)
View Java Teacher 's Profile
Try this one


class PersnDet
{
void printage(int a)
{
System.out.println("My age is "+a);
}
void printname(String n)
{
System.out.println("My name is "+n);}
}
class Print
{
public static void main(String[] args)
{
PersnDet me= new PersnDet();
me.printname("Akshaya");
me.printage(19);
}
}
Jan 6, 2014