Tag: programming languages
Questions Related to programming languages
For Object A to access method of object B, and the method has no modifier, Object A must be an instance of class which is ...
Each source file should have a public class in it ?
Methods which are marked as Protected can be accessed only by classes with in the same package?
Can abstract classes have non - abstract methods?
In a switch construct the execution will continue till
Using a break in a for loop , causes the loop to break out of the current iteration and jump to the next iteration of the loop...
class C{ int i; public static void main (String[] args) { int i; //1 private int a = 1; //2 protected int b = 1; //3 public int c = 1; //4 System.out.println(a+b+c); //5 }}
class C { public static void main(String[] args) { int i1=1; switch(i1){ case 1: System.out.println("one"); case 2: System.out.println("two"); case 3: System.out.println("three"); }}} What is the result of attempting to compile and run the program?