array(0) { }

Java Questions | count: 60

Questions Difficulty level Type Answer Options Tag(s)
Java is a general-purpose, object-oriented, high-level programming language with several features that make it ideal for web-based development1true-falseTrue
  • True
  • False
Java
A Java program is first compiled into processor-dependent byte codes, then the byte codes are interpreted at run time by the Java Virtual Machine1true-falseFalse
  • True
  • False
Java
A byte holds 8 binary digits1true-falseTrue
  • True
  • False
Java
The Java Runtime Environment (JRE) is a set of software tools for development of Java applications. It combines the Java Virtual Machine (JVM), platform core classes and supporting libraries1true-falseTrue
  • True
  • False
Java
A CPU understands only binary and hexadecimal numbers1true-falseFalse
  • True
  • False
Java
A bit can hold up to 16 binary digits1true-falseFalse
  • True
  • False
Java
In Java, there are different types of variables, but all types are Objects1true-falseFalse
  • True
  • False
Java
The float and decimal types are equivalent1true-falseFalse
  • True
  • False
Java
Every variable must be given a name and a data type before it can be used.1true-falseTrue
  • True
  • False
Java
Java supports eight different primitive data types, including byte and Boolean1true-falseFalse
  • True
  • False
Java
Strings are objects of Java’s String Class1true-falseTrue
  • True
  • False
Java
The + operator can be used between strings to add them together to make a new string OR you can use the concat() method to concatenate two strings1true-falseTrue
  • True
  • False
Java
A String in Java is an object, which contain methods that can perform certain operations on strings1true-falseTrue
  • True
  • False
Java
The slash (/) escape character turns special characters into string characters1true-falseFalse
  • True
  • False
Java
Java’s arithmetic operators are used for performing calculations on objects1true-falseFalse
  • True
  • False
Java
Explicit casting happens when calculations of mixed types are performed, lower-precision operands are converted, or promoted, to the type of the operand that has the higher precision1true-falseFalse
  • True
  • False
Java
User input can be read into our program from the keyboard, but not from a file1true-falseFalse
  • True
  • False
Java
The Scanner class provides methods for reading String and Integer data types1true-falseFalse
  • True
  • False
Java
The Scanner class is defined in the “java.util” package, so we need to include import the package1true-falseTrue
  • True
  • False
Java
In order to use the Scanner class, we must first instantiate a Scanner object and use the System.in input stream, which is tied to the keyboard1true-falseTrue
  • True
  • False
Java
nextLine() Reads a String value from the user1true-falseTrue
  • True
  • False
Java
Scanner scan = new Scanner(System.in); will create a Scanner object1true-falseTrue
  • True
  • False
Java
A class function is a blueprint or prototype from which objects are created1true-falseFalse
  • True
  • False
Java
Constructor declarations are done identically to method declarations1true-falseFalse
  • True
  • False
Java
Constructors are invoked to create objects from the class blueprint1true-falseTrue
  • True
  • False
Java
Non-static variables defined within a class are called instance variables because each instance of the class contains its own copy of these variables1true-falseTrue
  • True
  • False
Java
Any class can only contain a limited number of non-static methods, and each method can be only be called a limited number of times1true-falseFalse
  • True
  • False
Java
Static variables are associated with the class, rather than with any object1true-falseTrue
  • True
  • False
Java
Every instance of the class shares the class variable, which is in one fixed location in memory1true-falseTrue
  • True
  • False
Java
The static modifier should not be used with the final modifier to define constants1true-falseFalse
  • True
  • False
Java
Defined constants cannot be reassigned, and it is a compile-time error if your program tries to do so1true-falseTrue
  • True
  • False
Java
Object-oriented programming allows classes to inherit commonly used state and behavior from other classes1true-falseTrue
  • True
  • False
Java
In the Java programming language, each class is allowed to have one direct superclass, and each superclass has one subclass1true-falseFalse
  • True
  • False
Java
When a class implements an interface, it has the option to provide the behavior published by that interface1true-falseFalse
  • True
  • False
Java
If your class claims to implement an interface, all methods defined by that interface must appear in its source code before the class will successfully compile1true-falseTrue
  • True
  • False
Java
Access level (visibility) modifiers determine whether other classes can use a particular field or invoke a particular method1true-falseTrue
  • True
  • False
Java
If a class has no modifier, it is visible only within its own package1true-falseTrue
  • True
  • False
Java
The modifier known as package-private is identical to the public modifier1true-falseFalse
  • True
  • False
Java
The private modifier specifies that the member can only be accessed in its own class1true-falseTrue
  • True
  • False
Java
When a number of objects are created from the same class blueprint, they each have their own distinct copies of instance variables1true-falseTrue
  • True
  • False
Java
Class variables are referenced by the class name itself1true-falseTrue
  • True
  • False
Java
The Java programming language supports static methods as well as static variables1true-falseTrue
  • True
  • False
Java
The only required elements of a method declaration are the method's return type and a body between braces, {}1true-falseFalse
  • True
  • False
Java
Overloaded methods are differentiated solely by the number of arguments passed into the method1true-falseFalse
  • True
  • False
Java
Because clients cannot access private instance variables of a class, classes usually provide public accessor ( getter ) methods for the instance variables1true-falseTrue
  • True
  • False
Java
Control flow statements break up the flow of execution by employing decision making, looping, and branching, enabling your program to sequentially execute particular blocks of code1true-falseFalse
  • True
  • False
Java
The if-then statement tells your program to execute a certain section of code only if the conditional parameter is not empty1true-falseFalse
  • True
  • False
Java
If the test of the if-then statement evaluates to false, control jumps to the end of the if-then statement1true-falseTrue
  • True
  • False
Java
The while statement continually executes a block of statements only while a counter is smaller than a pre-defined value1true-falseFalse
  • True
  • False
Java
There is no difference between do-while and while statements1true-falseFalse
  • True
  • False
Java
An array is a container object that holds a fixed number of values of a single type1true-falseTrue
  • True
  • False
Java
The length of an array is established after the array is created1true-falseFalse
  • True
  • False
Java
Each item in an array is called an element, and each element is accessed by its numerical index (starting at 1)1true-falseFalse
  • True
  • False
Java
float arrFloats[]; is a valid declaration of an array of doubles1true-falseFalse
  • True
  • False
Java
arr = new int[10]; creates an array with the numbers from 1 to 101true-falseFalse
  • True
  • False
Java
The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified1true-falseTrue
  • True
  • False
Java
ArrayList cars = new ArrayList(); creates a new ArrayList of Strings1true-falseTrue
  • True
  • False
Java
To access an element in the ArrayList, use the get() method and refer to the index number1true-falseTrue
  • True
  • False
Java
To insert an element in the ArrayList, use the set() method and refer to the index number1true-falseFalse
  • True
  • False
Java
To remove an element in the ArrayList, use the remove() method and refer to the index number1true-falseFalse
  • True
  • False
Java