How to instantiate an object in java?

后端 未结 7 1060
不思量自难忘°
不思量自难忘° 2020-12-01 13:14

I\'m new in programming and I would like to know where did I go wrong in instantiating an object. Below is the code:

public class Testing{
    private int Sa         


        
7条回答
  •  Happy的楠姐
    2020-12-01 13:41

    Sample method returns integer, so get the result and use it anywhere.

    public static void main(String []args)
    {
        int myTest = Sample(4555);//input may be any int else
        System.out.println(myTest);
    }
    

提交回复
热议问题