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

  public class date {public static string date (string date , String month, string year) {string DDTET = date + "+ + + + +" + year; return DAPT;}}   

and there is another class here

  public class temperature range {public static string temperament (string high, string less) {string RTempRange = high + "high" + "" + less + "less"; return rTempRange;}}    

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:

  public class A {bb; //a reference bb = new b (); // class bb. make some (); / The method contained in class A from / class A Calling}   

B, which contains the doSomething () method, will appear as:

  public class b {public zero doSomething () { System.out.println ("Look, I'm doing something in class B!"); }}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -