Tap or click on cards to flip them and reveal the answers. You can use arrow keys as well.
Loading folders...
1/15 cards
What symbol is used to end a statement in Java?
Click to flip
A semicolon (;) is used to terminate a statement in Java.
Click to flip
What are the Java access modifiers?
Click to flip
The Java access modifiers include public, protected, private, and default, which control the visibility of classes, methods, and fields.
Click to flip
What are the primitive data types in Java?
Click to flip
The primitive data types in Java are int, char, boolean, byte, short, long, float, and double.
Click to flip
How do you write a single-line comment in Java?
Click to flip
A single-line comment in Java is written using double slashes: // comment.
Click to flip
How do you write a multi-line comment in Java?
Click to flip
A multi-line comment is written between /* and */ symbols.
Click to flip
What is the syntax to declare an array in Java?
Click to flip
An array in Java can be declared as int[] myArray = new int[10]; or int[] myArray = {1,2,3};
Click to flip
What is the use of 'import' in Java?
Click to flip
The 'import' statement in Java is used to bring other classes and packages into visibility, allowing their use in the current class.
Click to flip
How do you create an instance of a class in Java?
Click to flip
You create an instance of a class in Java using the 'new' keyword, like ClassName obj = new ClassName();
Click to flip
What is the difference between '==' and 'equals()' in Java?
Click to flip
'==' checks if two references point to the same object, while 'equals()' checks if the objects themselves are logically equal.
Click to flip
How do you handle exceptions in Java?
Click to flip
Exceptions in Java are handled using try-catch blocks, where code that might throw an exception is placed in the 'try' block, and the 'catch' block handles the exception.
Click to flip
What is a loop in Java?
Click to flip
A loop in Java is a construct that allows for repeated execution of a block of code, using structures like for, while, or do-while.
Click to flip
How is a switch statement structured in Java?
Click to flip
A switch statement in Java evaluates an expression and executes code blocks associated with matching cases or a default case.
Click to flip
What is 'this' keyword in Java?
Click to flip
The 'this' keyword refers to the current instance of a class, commonly used to access fields or call methods hidden by parameters or other scope variables.
Click to flip
What does 'final' keyword mean when applied to a variable, method, or class in Java?
Click to flip
The 'final' keyword makes a variable constant (unmodifiable), prevents a method from being overridden, and a class from being subclassed.
Click to flip
What is the purpose of the 'static' keyword in Java?
Click to flip
The 'static' keyword is used to denote that the field, method, or block belongs to the class rather than an instance, allowing access without creating an object.
Click to flip
Need More Study Materials?
Go back to the chat to generate additional resources.