Can someone tell me what\'s the correct answers? (Java Programming) Please expla
ID: 3886432 • Letter: C
Question
Can someone tell me what's the correct answers? (Java Programming)
Please explain
For each question below, highlight the only correct response. To run a Java program means to: a) Compile the source into byte code and execute it. b) Compile the source into machine code and execute it. Compile the byte code into machine code and execute it. d) Execute the byte code then the machine code. None of the above. In the Java program below, which statement would best replace the comment? public class Square Series { //declare MAX here public static void main(String[] args) { for (int i=0: iExplanation / Answer
1. To runa Java program means to
a )Compile the source into byte code and execute it.
explanation : in java, source code is compiled into byte code,by the java virtual machine.
once the compilation is done successfully , then it can be interpret and run applications on any Java VM,
2. In the Java program below, which statement would best replace the comment? public class SquareSeries f /declare MAX here public static void main(String args) f System. out. printin( i * i ); for ( int i=0; i<MAX; i++ ) } } enum MAX = 100; MAX 100; final int MAX = 100; final static int MAX = 100; static int MAX = 100;
answer:
final static int MAX = 100;
explanation:
final static int MAX=100; is used for declaration, in public main class.
static int MAX = 100; is used inside a local functions or methods.
final int MAX = 100; cannot be used, because non static variable cannot be referenced for static context.
//any clarification please do commnets
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.