Create a class named 'Programming'. While creating an object of the class, if nothing is passed to it, then the message "I love programming languages" should be printed.If some String is passed to it, then in place of "programming languages" the name of that String variable should be printed. For example, while creating the object if we pass "cpp", then "I love cpp" should be printed.
Answers
Answered by
7
Answer:The object name I am taking here is pro
Explanation:
import java.util.Scanner;
class programming
{
public static void main(String args[])
{
Scanner pro = new Scanner (System.in);
String = pro.nextLine();
if(string.length()>1)
System.out.println( "I love " +String);
else
System.out.println(" I love programming languages");
}
}
Hope it helps...
Please mark me the brainliest.
Answered by
2
Answer:
Ans give me .why it not share this
Similar questions