Explain the origin and the use of .class file in Java Programming.
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →Requirements: See attached file
Question One
Explain the origin and the use of .class file in Java Programming.
Question Two
Write a program that takes the birth year from the user and prints her/his age. Here are sample runs of the program:
Sample 1:
Enter your birth year: 1981
Your Age is: 42 years
Sample 2:
Enter your birth year: 2000
Your Age is: 23 years
Question Three
What is the output of each of the following? (Note: if there is an error, you must specify the type of the error: syntax error or runtime error or logic error)
a) (0.5 marks)
double a = 5;
double b = 2;
System.out.println(a+b);
b) (0.5 marks)
String a = “5”;
String b = “2”;
System.out.println(a+b);
c) (0.5 marks)
int a = “5”;
int b = “2”;
System.out.println(a+b);
d) (0.5 marks)
int a = 5;
int b = 0;
System.out.println(a/b);
e) (0.5 marks)
int a = 5;
int b = 2;
System.out.println(a%b);
f) (0.5 marks)
int a = 5;
int b = a++;
b +=5;
System.out.println(b++);
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds