2) Consider the program below a) public class ProgramGenerator { public static class Expression { private int lhs; public int getLhs() {return lhs;} public int setLhs(int lhs) {this.lhs = lhs;} private int rhs; public int getRhs() {return rhs;} public int setRhs(int rhs) {this.rhs = rhs;} private String operator; public String getOperator() {return operator;} public String setOperator(String operator) {this.operator = operator;} } public static void generateProgram(ProgramGenerator.Expression expression) { System.out.println("public class ConstructedProgram {"); System.out.println("public static void main(String[] args) {"); System.out.print("System.out.println("); System.out.print(expression.getLhs()); System.out.print(expression.getLhs()==7?"-":expression.getOperator()); System.out.print(expression.getLhs()==7?expression.getRhs()*2 :expression.getRhs()); System.out.println(");"); System.out.println("}\n}"); } ... } What is the output of the following code snippet: ProgramGenerator.Expression expression = new ProgramGenerator.Expression(); expression.setLhs(7); expression.setRhs(5); expression.setOperator("+"); ProgramGenerator.generateProgram(expression) b )Modify the class ProgramGenerator so that if LHS is 7, then the expression is changed in such a manner that the operator is inverted (i.e., + becomes - and - becomes +) and the RHS is multiplied by two. So, in the above example; the output of ConstructedProgram will be -3.
Cloud Support Engineer Interview Questions
9,818 cloud support engineer interview questions shared by candidates
How would you handle stock allocation during the checkout process?
pass-the-hash , biggest challenge for current Security teams etc.
Où est-ce que vous vous voyez dans 3ans, 5ans ? Que pensez-vous du DevOps ? de l'Infrastructure as code Que se passe-t-il quand on lance une VM dans OpenStack ? Différence entre images QCOW2 et RAW ? Questions sur admin linux (process, memoire, ...) Questions sur les bases en réseaux (protocoles, services, ...)
Background, skills and motivation evaluation
aws services, architecture, cicd with jenkins, docker and kubernetes
Write a python script which calculate CPU and Memory utilisation and send you a alert if it is more than threshold.
nothing out of resume and job description.
Tell me about a time when you had a problem and how did you solve it?
Was there a situation where you did not agree with your colleagues?
Viewing 9381 - 9390 interview questions