Click here to watch on Youtube:
https://www.youtube.com/watch?v=T7I1TJNx57U&list=UUhwKlOVR041tngjerWxVccw
MonthDemo.java
Output
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/MonthDemo_valueOf.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/MonthDemo_valueOf
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/1df932a97e40a15c12e3aa78c6f5eb64823918cb/BasicJava_2018/MonthDemo_valueOf/?at=master
See also:
All JavaEE Videos Playlist
All JavaEE Videos
All JAVA EE Links
Spring Tutorial
Servlets Tutorial
All Design Patterns Links
JDBC Tutorial
Java Collection Framework Tutorial
JAVA Tutorial
Kids Tutorial
Cooking Tutorial
https://www.youtube.com/watch?v=T7I1TJNx57U&list=UUhwKlOVR041tngjerWxVccw
MonthDemo.java
import java.time.Month;
public class MonthDemo
{
public static void main(String[] args)
{
/*
* Parameters:
*
* name - the name of the enum constant to be returned.
*
* Returns:
*
* the enum constant with the specified name
*/
Month month = Month.valueOf("JUNE");
System.out.println("Name = " + month.name());
System.out.println("Value = " + month.getValue());
}
}
public class MonthDemo
{
public static void main(String[] args)
{
/*
* Parameters:
*
* name - the name of the enum constant to be returned.
*
* Returns:
*
* the enum constant with the specified name
*/
Month month = Month.valueOf("JUNE");
System.out.println("Name = " + month.name());
System.out.println("Value = " + month.getValue());
}
}
Output
Name = JUNE
Value = 6
Value = 6
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/MonthDemo_valueOf.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/MonthDemo_valueOf
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/1df932a97e40a15c12e3aa78c6f5eb64823918cb/BasicJava_2018/MonthDemo_valueOf/?at=master
See also:
No comments:
Post a Comment