Category: Java

List toArray() Method

java.util.List.toArray() method can be used to convert a list to an array. Syntax of List toArray() Method Object[] java.util.List.toArray() The return type of this method is Object[]. Example.java The below… Read more »

Practice Problems on enum – Set2

Will the below code of enum compile?? MONTHS.java package com.masterjavatutorial; public enum MONTHS { public void methodOne(){ System.out.println(“Method One”); } } Semicolon is mandatory if any method is declared in… Read more »