Variable and print statement in java

Learn how to define Variables and print statements in java

public class VariableAndPrint {
public static void main(String args[]){
double apple;
apple = 30.30;

System.out.print(“I have “); // print in single line
System.out.print(apple);
System.out.println(” packages”); // print in new line

System.out.println(“Hello malik”); // print in next line
}

}

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.