You not login as Registered User...
basic concept of java

Ques->  what is oops?

Ans-> Object Oriented Programming Language is representing the concept of “Object”. In other words OOPs is a programming paradigm that provides many concepts such as Data Encapsulation, Polymorphism and Generalization & Inheritance.

Ques-> what is class?

Ans->   Group of Object is called class. In other words Class is used to manage Objects.

Ques-> what is object?

Ans-> A unique entity that has well-defined attributes and behavior is called object.

Ques-> what is the diff b/w method and constructer?

Ans-> Method have a return type while constructers don’t have an any return explicit, It is implicitly invoked just after an object is created.

      Method name can be same as class name as well as other name while constructer name must be a as a class name.

Ques-> Difference b/w interface and abstract class and similarities.

Ans-> interface have only abstract method while abstract can be abstract and non-abstract method.

      Similarities-> Interface and abstract class cannot be instantiated.

Ques-> why we use Constructor?

Ans-> It is used to initialize data members of objects.

Ques-> what is the purpose of default Constructor?

Ans-> if a class doesn’t contain any constructor then default constructor is provided by the compiler at the time of compilation but if a class contains any parameterized constructor and there is an object of the class which requires default constructor for its initialization then default constructor need to be defined in the class. In this case, it won’t be provided by the compiler.

Ques-> Constructer can be inherited?

Ans-> Constructer can't be inherited.

Ques-> which types of accesses modifier can apply with constructer?

Ans-> public, default, protected, private modifier can apply with constructer. Other modifier cannot be applying, like final, static, static abstract etc.

Ques-> what is ‘this keyword’?

Ans -> In Java, each non-static method & constructor has an implicit parameter named this which holds the reference of the invoking object. In other words it is hold the current reference id of the object.

Ques-> what is the difference b/t this and super keyword.

Ans-> this which holds the reference of the invoking object, while super keywords to invoke a superclass constructor from a subclass constructor.

Ques-> what is 'static keyword '?

Ans-> static keyword is used to define class members. In a class we can have following 3 types of class members: - STATIC DATA MEMBERS, STATIC INITIALIZE BLOCK and STATIC METHODS.

Ques-> what is static block?

Ans-> static block are used to initialize static data member, static block execute before any method (main also).

Ques-> can we execute a program without main method?

Ans-> we can execute a program without main method using static block. Because firstly execute static block so inside static block we can access method inside static block.

© 2014   Powered By ITSWS Pvt. Ltd.. All Rights Reserved.