Java Work

How To Print Double Quotes In Java In System.out.println Method.

public class DataTypes {

public static void main(String[] args) {

System.out.println(".......\"Lets begin with Java Data Types\"...  ");
//use the escape character \ (backlash). This character tells the
//compiler that the next character is part of an alternate instruction.
System.out.println((char)34+"Hello"+(char)34);
// how to print double quotes in Java in SOP statement


}

}


How To Call Main Method Explicitly

let create a class with main method


Now call main method present in mainexplicit class from Maincalling class.



JAVA 8 CHANGES IN INTERFACE

Till Java 7 we are not allowed to provide the definition of any function provided in interface.

However in Java 8 we can define as well as declare function in interface.

Note:- As per the changes in Java 8 we can define a method having static and default.

Please have a look to below mention screen prints.

Post a Comment