REVATURE COMPLETE REVIEW 2026
QUESTIONS WITH SOLUTIONS GRADED A+
◉String literals. Answer: Whenever it encounters a string literal in
your code, the compiler creates a String object with its value in this
case, "Hello world!'.
◉String constructor. Answer: Can take array of characters, String
literal, etc.
◉String length. Answer: name.length()
◉Concatenating. Answer: string1.concat(string2);
◉Get character at index of a String. Answer: char charAt(int index) -
Returns the character at the specified index.
◉Compare strings. Answer: int compareTo(Object o) - Compares
this String to another Object.
◉Check equality. Answer: boolean equals(Object anObject) -
Compares this string to the specified object.
,◉Check equal without case. Answer: boolean
equalsIgnoreCase(String anotherString) - Compares this String to
another String, ignoring case considerations.
◉Package. Answer: a group of similar types of classes, interfaces and
sub-packages
◉Two types of packages. Answer: 1. built-in
2. user-defined
◉Advantages of packages. Answer: - Java package is used to
categorize the classes and interfaces so that they can be easily
maintained.
- Java package provides access protection.
- Java package removes naming collision.
◉Package syntax declaration. Answer: //save as Simple.java
package com.revature;
public class Simple{
}
◉Package syntax usage. Answer: import package.*;
import package.classname;
, fully qualified name.
◉import package.*;. Answer: all the classes and interfaces of this
package will be accessible but not subpackages
◉import package.classname;. Answer: only declared class of this
package will be accessible.
◉fully qualified name.. Answer: - No need to import
- used when two packages have same class name e.g. java.util and
java.sql packages contain Date class
Ex: System.out.println("Hello");
◉Packages: order of operations. Answer: package -> import -> class
◉Interface. Answer: - a reference type in Java
- a collection of abstract methods
- A class implements an interface, thereby inheriting the abstract
methods of the interface
QUESTIONS WITH SOLUTIONS GRADED A+
◉String literals. Answer: Whenever it encounters a string literal in
your code, the compiler creates a String object with its value in this
case, "Hello world!'.
◉String constructor. Answer: Can take array of characters, String
literal, etc.
◉String length. Answer: name.length()
◉Concatenating. Answer: string1.concat(string2);
◉Get character at index of a String. Answer: char charAt(int index) -
Returns the character at the specified index.
◉Compare strings. Answer: int compareTo(Object o) - Compares
this String to another Object.
◉Check equality. Answer: boolean equals(Object anObject) -
Compares this string to the specified object.
,◉Check equal without case. Answer: boolean
equalsIgnoreCase(String anotherString) - Compares this String to
another String, ignoring case considerations.
◉Package. Answer: a group of similar types of classes, interfaces and
sub-packages
◉Two types of packages. Answer: 1. built-in
2. user-defined
◉Advantages of packages. Answer: - Java package is used to
categorize the classes and interfaces so that they can be easily
maintained.
- Java package provides access protection.
- Java package removes naming collision.
◉Package syntax declaration. Answer: //save as Simple.java
package com.revature;
public class Simple{
}
◉Package syntax usage. Answer: import package.*;
import package.classname;
, fully qualified name.
◉import package.*;. Answer: all the classes and interfaces of this
package will be accessible but not subpackages
◉import package.classname;. Answer: only declared class of this
package will be accessible.
◉fully qualified name.. Answer: - No need to import
- used when two packages have same class name e.g. java.util and
java.sql packages contain Date class
Ex: System.out.println("Hello");
◉Packages: order of operations. Answer: package -> import -> class
◉Interface. Answer: - a reference type in Java
- a collection of abstract methods
- A class implements an interface, thereby inheriting the abstract
methods of the interface