Simple program of Array Using Class and Method(Java) - HelpMeOutAlways

Wednesday, January 23, 2019

Simple program of Array Using Class and Method(Java)

Source Code

class MyPro{
      public void print(){
       int[ ] primes = {2, 3, 5, 7};
       
        for (int t: primes) {
            System.out.println(t);
        }
        }
}
public class Program {
    public static void main(String[] args) {
    
     MyPro obj=new MyPro();
     obj.print();
    }

}

 Output


#arrayprogramming #java #class #method

No comments:

@way2themes