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

What is array and arraylist in java?

0 Answers  


Differentiate between array list and vector in java.

0 Answers  


What is casting?

3 Answers   BMC,


What are the various access specifiers for java classes?

0 Answers  


what is request dispatcher and how does it work?

2 Answers   CTS,






how can i kill thread without stop() and destroy()

1 Answers  


What is class array in java?

0 Answers  


What does replaceall do in java?

0 Answers  


Can you explain the Java thread lifecycle?

1 Answers  


Distinguish method overloading and method overriding

4 Answers   Tech Mahindra,


What is keyword and identifier?

0 Answers  


if we give input as " hi how are you" then the output should be "uoy woh"...it should skip odd words in the input and should reverse even words from the end of string...can anyone help me to write this program in java

1 Answers  


Categories