programming languages Online Quiz - 179
Description: programming languages Online Quiz - 179 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
package exceptions; public class TestException3 { static double testException(int x, int y) { return (x/y); } public static void main(String[] args) { try { double p = testException(10,0); System.out.println("p = "+p); } catch(Exception e) { System.out.println("Exception happened "+e.getMessage()); System.exit(0); } finally { System.out.println("In finally"); } } }
package exceptions; public class TestException1 { static double testException(int x, int y) { return (x/y); } public static void main(String[] args) { try { double p = testException(10,0); System.out.println("p = "+p); System.out.println("Division done"); } catch(Exception e) { System.out.println("Exception happened "+e.getMessage()); } finally { System.out.println("In finally"); } } }
#include int main () { ;;;;;; " Please Execute Me " ;;;;; // Line 6 printf(" Executing... ") // Line 7 ;;;;;; "Executed" ;;;;;;; // Line 8 }
#include int main() { float dennis; switch(dennis) { default: printf("Let me work"); case 1: printf("This is case 1"); case 2: printf("This is case 2"); break; } }
package testswitch; public class TestSwitch { public static void main(String[] args) { int x = 2; switch (x) { default: System.out.println("Default"); break; case 3: System.out.println("I am in 3"); break; case 2: System.out.println("I am in 2"); break; } } }
package testswitch; public class TestSwitch1 { public static void main(String[] args) { int m=100; switch(100) { case m: System.out.println("in m"); default :System.out.println("default"); } } }
package testswitch; public class TestSwitch5 { public static void main(String[] args) { char a = 'a'; switch (a) { default: System.out.println("I am in default"); break; case 'a': System.out.println("I am in a"); break; } } }