when i write the following program---
public class Public_Private
{
public static void main(String args[])
{
Personal Dylan = new Personal();
Dylan.Name(Dylan.name);
Dylan.Birthdate(Dylan.birthdate);
Dylan.Weight(Dylan.weight);
Dylan.Hobbies(Dylan.hobbies);
Dylan.Religion(Dylan.religion);
Dylan.Address(Dylan.address);
Dylan.Visit(Dylan.visit);
}
}
class Personal
{
String name = "Name";
String birthdate = "may 25, 1995";
String weight = "3.5 lbs";
String hobbies = "Sitting, Music, Computers";
String religion = "Freestyle Christian";
String address = "3970 wouldnent you like to know :P";
String visit = "Julliard School Of Fine Arts";
public static String Name(String MyName)
{
System.out.println(MyName);
String name = "Name Method Finished";
return name;
}
public static String Birthdate(String MyBirthdate)
{
System.out.println(MyBirthdate);
String birthdate = "Birthdate method finished";
return birthdate;
}
public static String Weight(String MyWeight)
{
System.out.println(MyWeight);
String weight = "Weight method finished";
return weight;
}
public static String Hobbies(String MyHobbies)
{
System.out.println(MyHobbies);
String hobbies = "Hobbies method finished";
return hobbies;
}
public static String Religion(String MyReligion)
{
System.out.println(MyReligion);
String religion = "Religion method finished";
return religion;
}
public static String Address(String MyAddress)
{
System.out.println(MyAddress);
String address = "Address method finished";
return address;
}
public static String Visit(String MyVisit)
{
System.out.println(MyVisit);
String visit = "visit method finished";
return visit;
}
}
---
Instead of it printing "Name" and then returning the string "name method finished" it just prints "name" and skips the return altogether moving onto the next method call. why cant i get it to return the Strings?