java - How to call a method function from another class? -
I am writing a Java project that contains three different classes. It's so far away from me that I just have a function How to call from second class to second class I have already written 2 classes; I got the "Date" class and "TemperatureRange" category; Now I am trying to call those 2 classes in the "Weatherrecord" class. I'm not sure I'm right about this. This is another category and there is another class here You need reference of class, in which there is a method that you want to call. Suppose we have two classes, A and B. have a method that you want to call from A A class A will look like this: B, which contains the doSomething () method, will appear as:
public class date {public static string date (string date , String month, string year) {string DDTET = date + "+ + + + +" + year; return DAPT;}}
public class temperature range {public static string temperament (string high, string less) {string RTempRange = high + "high" + "" + less + "less"; return rTempRange;}}
public class A {bb; //a reference bb = new b (); // class bb. make some (); / The method contained in class A from / class A Calling}
public class b {public zero doSomething () { System.out.println ("Look, I'm doing something in class B!"); }}
Comments
Post a Comment