Submitted Questions

  • Inner Class

    Can we decalre java inner class as private and protected? If yes....please explain If No....please explain

    Priya

    • Jan 28th, 2013

    If it is a Regular Inner Class or Static Inner class private and protected modifiers can be applied. If it is a method local inner class, then we can use only abstract or final modifier.

  • Core Java Question

    Will it compile and run?? If No ... please explain? {geshibot language="java"} public class Test{ public static void main(String asd[]){ System.out.println(" Test!! "); } } protected class A{ } private class B extends A{ }{/geshibot}

    Sajad rasheed

    • Jun 15th, 2015

    In this case if will show compile time error because the order of access specifier is stronger to weaker and calling of parent requires super keyword which isnt written in code 

    venkataramana

    • May 29th, 2013

    First of it will not compile,because outer classes we cant create with the modifier protected