Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends i have one problem about method calling. here is my code and iam confused to call this method in student class.

What I have tried:

Java
package assignment3;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.Date;
public class student implements Comparable



this is the method that i need to call from the student class

Java
private static String [] compareDOB(student[] students){
       //Comparator
Posted
Updated 6-Oct-16 21:28pm
v3
Comments
Suvendu Shekhar Giri 7-Oct-16 1:35am    
Just call the method with required parameters, what is the issue here?
nuke_infer 7-Oct-16 1:39am    
i need to call this this method from the student class. could you please tell me how to do this

1 solution

Since it is a static method, you may call it this way:
Java
String [] result = classname.compareDOB( students );


where:
  • students is an arary of student objects.
  • classname is a placeholder for the actual class implementing the compareDOB method (you didn't state which class is actually implementing it).
 
Share this answer
 
Comments
nuke_infer 7-Oct-16 3:58am    
/*this is the method */

private static String [] compareDOB(student[] students){
//Comparator

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900