
Java syntax
Flashcard
•
Computers
•
University
•
Practice Problem
•
Easy
Prof Yetty
Used 7+ times
FREE Resource
Student preview

59 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is the correct file extension for a Java program? Options: .java, .js, .py, .txt
Back
.java
Answer explanation
Java files are saved with a .java extension.
2.
FLASHCARD QUESTION
Front
Which keyword is used to declare a variable? Options: variable, var, int, let
Back
int
Answer explanation
In Java, 'int' is used for integer variables.
3.
FLASHCARD QUESTION
Front
What does the 'public' keyword signify in Java?
Back
It is accessible to all
Answer explanation
public' allows access from any class in the program.
4.
FLASHCARD QUESTION
Front
How do you print text to the console in Java?
Back
System.out.println()
Answer explanation
System.out.println() is the correct way to print to the console in Java.
5.
FLASHCARD QUESTION
Front
What happens if a local int variable is used without initialization?
Back
It is initialized to 0.
Answer explanation
"Local variables in Java must be explicitly initialized before use, as they do not have default values. Attempting to use an uninitialized local variable results in a compilation error.
6.
FLASHCARD QUESTION
Front
What symbol is used to end a Java statement?
Back
;
Answer explanation
Java statements end with a semicolon (;).
7.
FLASHCARD QUESTION
Front
What is the correct syntax for a single-line comment?
Back
//
Answer explanation
Single-line comments in Java start with //.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
64 questions
WP Chapter 1
Flashcard
•
University
40 questions
Directions - English to Estonian
Flashcard
•
University
50 questions
Ancient greece
Flashcard
•
9th - 12th Grade
50 questions
LANGUAGE ARTS LAB 11th
Flashcard
•
11th Grade - University
54 questions
English-Polish Vocabulary Flashcards
Flashcard
•
KG
55 questions
Romanesque Architecture
Flashcard
•
University
44 questions
Job and Employment Vocabulary
Flashcard
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade