elect the correct answerWhat is the output of the following program?public class Test{ private String function(String temp, int data, int sum) { return ("CTC"); } private String function(String temp, int data) { return ("CodeTantraCode"); } public static void main(String[] args) { Test obj = new Test(); System.out.println(obj.function("CTC", 0, 20)); }}OptionsRuntime errorCompilation errorCTCCodeTantraCode
Question
elect the correct answerWhat is the output of the following program?public class Test{ private String function(String temp, int data, int sum) { return ("CTC"); } private String function(String temp, int data) { return ("CodeTantraCode"); } public static void main(String[] args) { Test obj = new Test(); System.out.println(obj.function("CTC", 0, 20)); }}OptionsRuntime errorCompilation errorCTCCodeTantraCode
Solution
CTC
Similar Questions
Select the correct answer What is the output of the following program? public class Marks{ private String function() { return ("CTC"); } public final static String function(int data) { return ("CodeTantraCode"); } public static void main(String[] args) { Marks obj = new Marks(); System.out.println(obj.function()); }}OptionsCTCRuntime errorCompilation errorNone of these
Select the correct answerWhat will be the output of the following Java code? class Codetantra { final public int output(int x, int y) { return 1; } } class Program extends Codetantra { public int output(int x, int y) { return 2; } } public class result { public static void main(String args[]) { Program object = new Program(); System.out.print("y is " + y.output(0, 1)); } }Optionsy is : 0y is : 1Compilation ErrorAn exception is thrown at runtime
Select the correct answerWhat will be the output of the following Java code? class Name { public static void main(String args[]) { try { int ct1 = 0; int ct2 = 5; int ct3 = ct1 / ct2; System.out.print("Hello"); } catch(Exception e) { System.out.print("Codetantra"); } } }OptionsCodetantraHelloHelloCodetantraCompilation Error
elect the correct answerWhat is the output of the following program?public class Score{ public static void main(String[] args) { int value = 121; String var = (String)value; //line 1 String temp = "122"; int data = (int)temp; //line 2 System.out.println(data + var); }}OptionsCompilation error due to line 2Compilation error due to line 1243Compilation error due to line 1 and line 2
Select the correct answerWhat is the output of the following program?public class Test{ public static void main(String []args){ int i = 0; for(i = 0; i < 10; i++){ continue; } System.out.println(i); }}OptionsCompilation error0109
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.