100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

Intro to Java Programming Questions and Answers (Expert Solutions)

Rating
-
Sold
-
Pages
27
Grade
A+
Uploaded on
30-07-2025
Written in
2024/2025

Intro to Java Programming Questions and Answers (Expert Solutions)

Institution
Java Programming
Course
Java Programming










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Java Programming
Course
Java Programming

Document information

Uploaded on
July 30, 2025
Number of pages
27
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Page | 1



Intro to Java Programming Questions and
Answers (Expert Solutions)

Q: Which of the following are storage devices?

Select one or more:
A. floppy disk
B. hard disk
C. flash drive

D. CD-ROM, 🗹🗹: A, B, C, and D

Q: Select the item that doesn't belong on the list.
A. software
B. machine language
C. JVM
D. bytecode

E. CPU, 🗹🗹: E

Q: The Java compiler translates source code into __________.
Select one:
A. Java bytecode
B. machine code
C. assembly language code

D. none of the above, 🗹🗹: Java bytecode

Q: For the Java program below, what file name should the source code be stored in?
public class MyProg{System.out.println( "Hello World" );}
Select one:
A. MyProg.txt
B. MyProg.docx
C. MyProg.java

D. Any file name with a .java extension, 🗹🗹: MyProg.java

Q: Which of the following is the correct way to write the header for a main method?
Select one:
A. public static void main( string [] args )

, Page | 2

B. public static void main( String [] args )
C. public static void Main( String [] args )

D. public static main( String [] args ), 🗹🗹: public static void main( String [] args )

Q: __________ is considered to be the brain of a computer.
Select one:
A. hardware
B. CPU
C. memory

D. disk drive, 🗹🗹: CPU

Q: Which JDK command will compile a Java program named YourProgram?
Select one:
A. java YourProgram
B. java YourProgram.java
C. javac YourProgram.java

D. javac YourProgram, 🗹🗹: javac YourProgram.java

Q: What is the output of the following program?
public class 6Times2{public static void main( String [] args ){System.out.println( "6 times
2 is 12" );}}
Select one:
A. "6 times 2 is 12"
B. 6 times 2 is 12
C. The program will not compile

D. The program will compile, but it will produce a runtime error, 🗹🗹: The program
will not compile

Q: Which of the following statements are true? (select all that apply)
Select one or more:
A. The Java compiler translates source code into machine language that can be directly
executed on a computer.
B. The output file produced by the Java compiler is architecturally neutral.
C. A Java program named MyProgram should be stored in a file named MyProgram.java.

D. The Java language is a high-level programming language., 🗹🗹: A and D

Q: What was the original name for the Java language?
Select one:
A. Java

, Page | 3

B. Oak
C. Maple

D. D, 🗹🗹: Oak

Q: What is the output of the following code?
public static void main( String [] args ){int a;int b = 10;a = 9;c = a + b;System.out.println( a
+ "\t" + b + "\t" + c );}
Select one:
A. 9 10 19
B. a = 9 b = 10 c = 19
C. The program will not compile and run

D. The program will compile, but a runtime error will be generated, 🗹🗹: The
program will not compile and run

Q: Which of the following is accomplished in the Java statement int myVariable; ? (select
all that apply)
Select one or more:
A. The name myVariable is made known to a portion of the program.
B. The data type int is associated with myVariable.
C. The value of myVariable is initialized to zero by default.

D. The value of myVariable is not initialized., 🗹🗹: A,B, and D

Q: Which of the following are valid Java variable names? (select all that apply)
Select one or more:
A. Hello
B. test_score
C. 4ere
D. 5+5

E. float, 🗹🗹: A and B

Q: Which of the following statements is true?
Select one:
A. The portion of a program over which a variable is known and can be referenced is
called a variable's duration.
B. The portion of a program over which a variable is known and can be referenced is
called a variable's lifetime.
C. The portion of a program over which a variable is known and can be referenced is
called a variable's scope.
$13.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
StudyRM

Get to know the seller

Seller avatar
StudyRM University Of California - Los Angeles (UCLA)
View profile
Follow You need to be logged in order to follow users or courses
Sold
4
Member since
6 months
Number of followers
0
Documents
4114
Last sold
6 hours ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions