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

Explain the importance of finally block in java?

0 Answers  


Explain the private protected method modifier?

0 Answers  


What is singleton math?

0 Answers  


What are user defined exceptions?

0 Answers  


What is native code?

0 Answers  


What does super keyword do?

0 Answers  


perpare on factorypattern,linklist wothout using collection, (multitharding ie create producer/customer therad producer create Queue continuesly,consumer consume queue, consumer wait if queue is full,producer wait if queue is empty),diff betn sleep(1000)&wait(1000) these r the main Q ask in huawei(2008)

1 Answers   Huawei,


What does those terms actually mean included in the j.d.k i.6?

0 Answers  


Why is singleton instance static?

0 Answers  


What is audio clip interface? Name few methods of it ?

1 Answers  


Is the empty set a singleton?

0 Answers  


How can the checkbox class be used to create a radio button?

0 Answers  


Categories