1. Java Variables, Types and Syntax

Variables and Types in Java

Java is a statically typed language. Every variable must have a declared type:
String baseUrl = "https://targetqa.com";
int timeoutSeconds = 30;
boolean isHeadless = true;
double responseTime = 1.45;

if (timeoutSeconds > 10) {
System.out.println("Using extended timeout: " + timeoutSeconds + "s");
}

Task

  • Implement buildAppUrl in Java:
  • 1. Accept String path.
  • 2. Return "https://targetqa.com" + path.
πŸ’‘Common doubts
Did you like the problem?
Lesson 1 of 18
Java
Loading code editor…
Next