Chapter1 Flashcards
1
Q
How does java work?
A
- You write a source code.
- Compiler (checks for errors and will only run if everything is correct)
- Output code (compiler makes the bytecode which is .class)
- Virtual Machine takes the .class and translates it into what the platform understands and runs the program.
2
Q
What is the source file?
A
it is the .java file. you put a class
3
Q
WAP to check if the number is prime or not
A
for (int i =2; 2/num; ++i){
if(num%2==0){primeflag==true}
else{