Most important java program interview Questions.

Post Views: 1,077 The most important java program interview questions to crack the interview. Write a program to print 1 to 10? public class Main{public static void main(String args[]){ int n=10;int i;for(i=1;i<=n;i++){System.out.println(i);}}} Write a program to print * pattern? public class Main{ public static void main(String args[]){ int n=10; int i; int j; for(i=1;i<=n;i++){ for(j=1;j<=i;j++){ System.out.print(“*”); } System.out.println(“”); } } } Write a program to print even number? public class Main{ public static void main(String args[]){ int n=10; int x; x=n%2; if(x==0){ System.out.println(“even”); } else{ System.out.println(“odd”); } } } Write…

Read More