package com.codegym.task.task05.task0508;
/*
Getters and setters for the Person class
*/
public class Person {
//write your code here
public static void main(String[] args) {
String name;
int age;
char sex;
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public int getAge()
{
return age;
}
public void setAge(int age)
{
this.age = age;
}
giving me " illegal start of expression: Person.java, line: 15, column: 9" error y????
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Optimus2000
7 May 2020, 20:37
None of your code should be written in the main method. They should be in the person class before the main method! the place where it says write your code here.
+1
Suhas Digambare
6 December 2018, 03:54
Write all your methods inside class body........
right after the line says .............//Write your code here
0
Khurram
4 December 2018, 11:41
all the method definitions here are placed inside the main, they should be outside the main method
+3