Java Basic Objective Question

1. What is the size of byte variable? a) 8-bitb) 16-bitc) 32-bitd) 64-bit 2. What is the default value of float variable? a) 0.0db) 0.0fc) 0d) 0.0 3. Which of the following is not a keyword in Java? a) staticb) Booleanc) voidd) private 4. Which method must be implemented by all threads? a) run()b) start()c) … Read more

50+Collection Based Objective Question

1. What will be the output of the following code? java import java.util.*; public class Test {     public static void main(String[] args) {         List<String> list = Arrays.asList(“one”, “two”, “three”);         list.forEach(System.out::println);     } } a) one two threeb) three two onec) one twod) Compilation Error 2. What will be the output of the … Read more

Java Basic code snippet based Question

1. What will be the output of the following code? java public class Test {     public static void main(String[] args) { System.out.println(“Hello, World!”);     } } a) Hello, Worldb) Hello, World!c) Compilation Errord) Runtime Error 2. What will be the output of the following code? java public class Test {     public static void … Read more

Java 8 Objective Questions

1. Which of the following feature is introduced in Java 8? a) Serializationb) Stream APIc) Abstractiond) Polymorphism 2. Which of the following is not a core concept of Java 8’s new date and time API? a) ZonedTimeb) LocalDatec) LocalDateTimed) ZonedDateTime 3. Which of these is a new method added to the Collection interface in Java … Read more