The Artima Developer Community
Sponsored Link

Java Answers Forum
can some1 tell me what is wrong with this code

1 reply on 1 page. Most recent reply: Mar 5, 2003 10:33 PM by Madhu

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Brian

Posts: 1
Nickname: nuclearx
Registered: Mar, 2003

can some1 tell me what is wrong with this code Posted: Mar 3, 2003 7:35 AM
Reply to this message Reply
Advertisement
create a class name studrec that has two private member variable. studname of type string and test of type float.ok
implement an accessor method test() that return the test marks
implement a constructor that takes in an argument S of type String for studname and the test mark us assignemnt valued.
implement a constructor that takes two argument S of type string pass to the constructorwith an argument S and test of type float for member test
implement a display()that print member variable
save the file as recstud that has an array of 5 students the students are
john
mike 84
peter 60
handsome
pretty 70
//below is what i have code

class StudRec {
private String StudName;
private float test;

public StudRec(String S) { StudRec = john,mike,peter,handsome,pretty;}

public StudRec(String S, float test) {test = 84,60,70;}
public float GetTest() {return test;}
public void PrintMember() {
System.out.println ("Student Record" +S);
}

class RecStud{
public static void main(String[]args)
{ array studarray=new array();
System.out.println("Student Record" +StudRec());

}//end main
}// end RecStud


Madhu

Posts: 2
Nickname: mib
Registered: Mar, 2003

Re: can some1 tell me what is wrong with this code Posted: Mar 5, 2003 10:33 PM
Reply to this message Reply
u first know the BAsic's of java
ie what is class

Flat View: This topic has 1 reply on 1 page
Topic: interview questions Previous Topic   Next Topic Topic: problems with jar files

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use