"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Pradeep mca wrote: Recently my friend have attended an interview, in that the interviewer asked
write code to get the output of if..else with out using if else and any other controle statements?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Pradeep mca wrote: Recently my friend have attended an interview, in that the interviewer asked
write code to get the output of if..else with out using if else and any other controle statements?
Pradeep mca wrote: write code to get the output of if..else with out using if else and any other controle statements?
Federico Cardelle wrote:
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Jai Mani wrote:What about switch and ? : are they not allowed as well ?
Knowledge Reigns Supreme
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Seetharaman Venkatasamy wrote:
Pradeep mca wrote: write code to get the output of if..else with out using if else and any other controle statements?
your opinion?
Jai Mani wrote:Although this is bad design but maybe you can use assert ?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Java Control statements control the order of execution in a java program, based on data values and conditional logic. There are three main categories of control flow statements;
· Selection statements: if, if-else and switch.
· Loop statements: while, do-while and for.
· Transfer statements: break, continue, return, try-catch-finally and assert.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie wrote:I think this discussion has now reached the standard of creativity meriting transfer to the diversions forum
![]()
Rob Spoor wrote:
Ashutosh Limaye wrote:The ternary operator [ <condition>?<operation if true>:<operation if false> ]!? eg: x<10?true:false;
Which a) is technically a control statement (and therefore not allowed), and b) cannot handle anything that does not return a value.
SCJP
Visit my download page
Campbell Ritchie wrote:Is the result of a==b defined in C? Does it always return 1 for true? Can it return -1 for true, as happens in many languages.
Where does a nanny get ground to air missles? Protect this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|