Java Hyd Team pinned ยซString valid = "true";if (valid) { System.out.println ("valid");}else { System.out.println ("not valid");}What is the result?ยป
TOMORROW LET'S HAVE A TEST ONLINE (QUIZ )
Anonymous Poll
94%
JAVA (3hours )1.5mnts per question
6%
Nope
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
public class DayOfDate {
public static void main(String[] args) {
// Create a DateTimeFormatter object
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
// Get the current date
LocalDate currentDate = LocalDate.now();
// Parse the given date
LocalDate givenDate = LocalDate.parse("09/11/1999", formatter);
// Get the day of the given date
String dayOfGivenDate = givenDate.getDayOfWeek().name();
// Print the day of the given date
System.out.println("Day of the given date is: " + dayOfGivenDate);
}
}
import java.time.format.DateTimeFormatter;
public class DayOfDate {
public static void main(String[] args) {
// Create a DateTimeFormatter object
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
// Get the current date
LocalDate currentDate = LocalDate.now();
// Parse the given date
LocalDate givenDate = LocalDate.parse("09/11/1999", formatter);
// Get the day of the given date
String dayOfGivenDate = givenDate.getDayOfWeek().name();
// Print the day of the given date
System.out.println("Day of the given date is: " + dayOfGivenDate);
}
}