Question
What is the result of the code below: int[] val=new int[8]; for(int i=0;i <8;i++) val[i]=i*i; System.out.println(val[3]); What will happen if the file c:/myData/names.txt doesn't exist?
What is the result of the code below:
int[] val=new int[8]; for(int i=0;i<8;i++) val[i]=i*i; System.out.println(val[3]);
What will happen if the file "c:/myData/names.txt" doesn't exist?
Scanner diskScanner = new Scanner(new File("c:/myData/names.txt"));
What is the result of the code below:
int numbers[] = {1, 4, 2,8}; for (int num : numbers) { System.out.print(num+" ");
}
What is output by this code:
System.out.println("Hello World");
What is output by this code:
int[] num={7,8,5,3,1}; System.out.println(num[1]);
What is true about this code: Select ALL that apply.
int[] num=new int[3];
num[0]=9; num[1]=3; num[2]=(num[0] ? is called a definitive operator It prints 3 The ? selects one of the values randomly. The last element is the smallest. Copy of What will happen if the file "c:/myData/names.txt" doesn't exist? Scanner diskScanner = new Scanner(new File("c:/myData/names.txt")); Which is the proper declaration for an array of characters. char[] ltr={'a','b','c','d','e','f','g'}; char ltr[] ={'a','b','c','d','e','f','g'}; character[] ltr =['a','b','c','d','e','f','g']; char ltr =['a','b','c','d','e','f','g']; What is output by the code below: int num[]={3,5,6,10,20}; for(int i=2;i<4;i++) System.out.print(num[i]+" "); What is the result of the code below: double[] numbers={5.2,3.8,9.1}; System.out.println(numbers[3]); an error no output 5.2,3.8,9.1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started