Hey, Hi all!
I'm a bachelor student, new to Java.
Following code is giving error in PrintDetails()
What parameters should I define in it??
Kindly check and tag out my mistakes in the following code.. Thanks ^_^

class student
{
String a;String b;char c;double d;
student(String name,String rollno,char gender,double gpa)
{
    a= name; 
    b= rollno;
    c= gender; 
    d= gpa;
}}
class teacher
{
String e;String f;long g;String h;
teacher(String name,String address,long telephoneno,String degree)
{
    e=name;
    f=address;
    g=telephoneno;
    h=degree;
}}
class course
{
    student s1;
    student s2;
    teacher t1;
    int age;
course(student x,student y,teacher z)
{
    s1=x;
    s2=y;
    t1=z;
}
void printDetails()
{
System.out.println();
}}
public class test1
{
public static void main(String args[])
{
    student name=new student();
    course c1=new course("aaaa","11cs11",'f',6.8);
    course c2=new course("uuu","8u8",'p',7.9);
    course c3=new course("uuuttt","99oi88",'m',9.7);
    course j[]={c1,c2,c3};
    c1. printDetails();
    c2.printDetails();
    c3.printDetails();
}}

Recommended Answers

All 2 Replies

code is giving error

Please post the full text of the error message.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.