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 are alternatives to java serialization?

0 Answers  


How can we pass argument to a function by reference instead of pass by value?

0 Answers  


What is difference between call by value and call by reference?

0 Answers  


When a byte datatype is used?

0 Answers  


Can you declare an interface method static?

0 Answers  






Which collection does not allow duplicates in java?

0 Answers  


how to call a method in different package?

4 Answers  


In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

0 Answers  


What are the restrictions imposed by a Security Manager on Applets?.

0 Answers  


Does garbage collection guarantee that a program will not run out of memory?

1 Answers  


What do you mean by synchronized non access modifier?

0 Answers  


How can a gui component handle its own events in java programming?

0 Answers  


Categories