File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A program in Core Java

 
Sailendra Kumar Barick
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone write the code in core java-
Input three numbers through Scanner class in variables a,b c.
If a is inputted 1, b inputted null(or blank) and c inputted 3 then output should show a=1 & b=3.
If a is null(or blank), b is 1,c is 4, then output- b=1 & c=4.
If a is 1, b is 2, c is 3, then output- a=1,b=2 & c=3.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can, yes. Will, no.
Please show us what you have got so far and we shall tell you what we think of it.
 
Sailendra Kumar Barick
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Can, yes. Will, no.
Please show us what you have got so far and we shall tell you what we think of it.


I've done it in a inefficient lengthy way, but i need to know any other way of doing it...
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not use a switch?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic