How to print a statement without using semicolan in java

Answers were Sorted based on User's Feedback



How to print a statement without using semicolan in java..

Answer / sadikhasan palsaniya

for (int i=0;i<1;System.out.println("Sadikhasan
Palsaniya"),i++);

Is This Answer Correct ?    22 Yes 4 No

How to print a statement without using semicolan in java..

Answer / srinivaskumar.nimmana

Write like this to print...

if(system.out.printf("hello sree")==null)

here we r using printf instead of println()

Is This Answer Correct ?    25 Yes 9 No

How to print a statement without using semicolan in java..

Answer / prince kohli

claass WithoutSemicolon
{
public static void main(String args[])
{
if(System.out.printf("hello java")==null)
{}
}
}

Is This Answer Correct ?    10 Yes 3 No

How to print a statement without using semicolan in java..

Answer / amit sharma

public static void main(String[] args) {

if(System.out.printf("hi",null) == null)
{
System.out.println("byee");
}
}


In printf(String format, Object args), We also need to
specify argument.

Is This Answer Correct ?    2 Yes 2 No

How to print a statement without using semicolan in java..

Answer / nagireddy

BufferedWriter bw=new BufferedWriter(new PrintWriter(System.out));
//Scanner scan=new Scanner((Readable) System.out);
bw.write("nagi");
bw.close();

Is This Answer Correct ?    0 Yes 0 No

How to print a statement without using semicolan in java..

Answer / abhishek sahu

class PrintDemo
{
if(System.out.println("Hello"))
{
}
}

Is This Answer Correct ?    2 Yes 12 No

Post New Answer

More Core Java Interview Questions

Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.

2 Answers   iGate, Seed Infotech,


What are the important features of Java 9 release?

0 Answers  


What are the different types of multitasking?

0 Answers  


Is set ordered in java?

0 Answers  


How do you clear an arraylist in java?

0 Answers  






What is local class in java?

0 Answers  


Which sorting algorithm is best in java?

0 Answers  


what is difference between abstract factory and factory design patterns?

0 Answers  


What does += mean in java?

0 Answers  


what is a transient variable?

5 Answers  


What is extension method in java?

0 Answers  


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

0 Answers  


Categories