1.
public class Test{ public static void main(String[] args){ int i; for(i = 1;i <= 5;i++){ System.out.println("Welcome to java"); } } }
public class Test{ public static void main(String[] args){ System.out.println(" J A V V A "); System.out.println(" J A A V V A A "); System.out.println(" J J A A A V V A A A "); System.out.println(" J J A A V A A "); } }
2.
public class AverageSpeed{
public static void main(String[]args){
double speedkm =60/(45.5/14);
double speedm = speedkm /1.6;
system.out.println(“averagespeed = ”+speedm + "m/h")
}
}
3.
public class Circle{
private double r;
public Circle(double r){
this.r =r;
}
public double getLength(){
return 2*Math.PI*r;
}
public double getArea(){
return Math.PI*r*r;
}
}