A. public static int main(char args[]) B. public static void main(String args[]) C. public static void MAIN(String args[]) D. public static void main(String args) E. public static void main(char args[])
public static void main(String [] args)
public class Xyz { public static void main(String args[]) { for(int i = 0; i < 2; i++) { for(int j = 2; j>= 0; j--) { if(i == j) break; System.out.println("i=" + i + " j="+j); } } } }
a. i=0 j=0 b. i=0 j=1 c. i=0 j=2 d. i=1 j=0 e. i=1 j=1 f. i=1 j=2 g. i=2 j=0 h. i=2 j=1 i. i=2 j=2
java Test 2Select the one correct answer.
public class Test { public static void main(String args[]) { Integer intObj=Integer.valueOf(args[args.length-1]); int i = intObj.intValue(); if(args.length > 1) System.out.println(i); if(args.length > 0) System.out.println(i - 1); else System.out.println(i - 2); } }
A. Test B. Test -1 C. 0 D. 1 E. 2
arr
can be determined by utilizing the length
property of the array. The expression to represent this is written as `arr.length`. This property provides the total count of elements that the array can hold, which is set at the time of its creation and remains fixed throughout the array's lifetime.
int size = arr.length;
public class Test1 { public static void main(String[] args) { String s1= "example"; System.out.println(s1.substring (2, 4)); s} }