Core Java Interview Questions

Showing Questions 541 - 560 of 589 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page:
  •  

    Why abstract class is not create the object?

    Anil K Muraleedharan

    • Aug 15th, 2015

    Abstract classses are not complete by itself to be instantiated. There are some methods in that are not implemented. Hence you have to inherit it before using it. Even if you have implemented all methods in a class, if you put the keyword abstract, the class is deemed as abstract class.

    Akhil behara

    • Aug 13th, 2015

    Personally I very much dislike this term (except of course when referring to the book of the same name). There is "Java SE" which is a perfectly valid name for "Java thats not EE or ME". "Core Java" i...

  •  

    Why java does not support Multiple Inheritance?Why java is not pure Object Oriented?

    RaghunathBhairavaJosula

    • Aug 23rd, 2015

    Java does not support Multiple inheritance by extending multiple classes as in its constructor we call one super class constructor by super(). But still we can achieve the multiple inheritance by implementing N number of interfaces.

    Ravi

    • Dec 1st, 2014

    The Reason here is.... In our class (Class C) if I write super inside the constructor it needs to go to immediate super class(B). If my class C extends two classes( B and A), and in my class if i writ...

  •  

    What is the difference between Static and final?

    Jitendra singh

    • Sep 23rd, 2015

    Actually main reason that new make a class create only print my name not use object. You can create a simple program without using object this reason Java not 100% object oriented language {geshibot l...

    SHWETHA g

    • Aug 31st, 2015

    "Static" keyword is used to a variable/method where a value of that variable has to be common to all objects created for example: bank interest rate for farmers loan common to all farmers.
    where as "final" is to make a method or variable that should not be modified once after implementing.

  •  

    Core Java and Java

    What are differences between Core Java and Java?

    Raviteja alluri

    • Oct 19th, 2015

    The difference between Core Java and Java is Core Java : It will covers all basic things like OOPS concepts, Exception Handling, Collections, IoStreams etc Java : It will also covers oops concepts an...

  •  

    Why Hash table doesn't allow null values as well as null keys?

    Vinay Kumar

    • Nov 23rd, 2015

    Hashtable is a legacy class. hash table doesnt allow duplicate object as a key and value beacause hashtable implements hashcode () method. Hash code method compute object hashcode number if object is ...

  •  

    OOPs Interface

    Why interfaces is needed in Java?

    sreenivasulu

    • Dec 2nd, 2015

    Of course that is right answer. Mainly using interface we are achieving abstraction in Java.

    Sreenivasulu Medepalli

    • Dec 2nd, 2015

    If you don't know full implementation of that class at that situation we need to go for interface. In subclass we are implementing that interface and methods.

  •  

    Query multiples

    You are given an array arr with indices numbered from 1 to N.

    You will be given Q queries of the form i X. This query means, consider all arr[i], arr[i+1], .. arr[N] and, among these numbers, output the number of multiples of X.

    Input:

    First line consists of two integers; N and Q.

    Next Q lines consist of one query, as described in the problem statement.

  •  

    What is MVC architecture

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Mitchel K

    • Jun 27th, 2005


    A design pattern describes a proven solution to a recurring design problem, placing particular emphasis on the context and forces surrounding the problem, and the consequences and impact of the solution.  
     
    There are many good reasons to use design patterns. Here are three: 
     
    1) They are proven. You tap the experience, knowledge and insights of developers who have used these patterns successfully in their own work. 
     
    2) They are reusable. When a problem recurs, you don't have to invent a new solution; you follow the pattern and adapt it as necessary. 
     
    3) They are expressive. Design patterns provide a common vocabulary of solutions, which you can use to express larger solutions succinctly. 
     
    The goal of the MVC design pattern is to separate the application object (model) from the way it is represented to the user (view) from the way in which the user controls it (controller).  
     
    The MVC architecture has the following benefits: 
     
    1) Multiple views using the same model: The separation of model and view allows multiple views to use the same enterprise model. Consequently, an enterprise application's model components are easier to implement, test, and maintain, since all access to the model goes through these components. 
     
    2) Easier support for new types of clients: To support a new type of client, you simply write a view and controller for it and wire them into the existing enterprise model. 
     
    3) Clarity of design: By glancing at the model's public method list, it should be easy to understand how to control the model's behavior. When designing the application, this trait makes the entire program easier to implement and maintain. 
     
    4) Efficient modularity: of the design allows any of the components to be swapped in and out as the user or programmer desires - even the model! Changes to one aspect of the program aren't coupled to other aspects, eliminating many nasty debugging situations. Also, development of the various components can progress in parallel, once the interface between the components is clearly defined.  
     
    5) Ease of growth: Controllers and views can grow as the model grows; and older versions of the views and controllers can still be used as long as a common interface is maintained.  
     
    6) Distributable: With a couple of proxies one can easily distribute any MVC application by only altering the startup method of the application.

    yura

    • Dec 2nd, 2015

    Everyone explained what is MVC... This is outcome of one more design pattern called "separation of concerns", which means a "view" should only handle rendering logic of the model and should not be co...

    Anil Nivargi

    • Jun 26th, 2014

    The MVC consists of three kinds of Objects i.e Model,View and Controller. Lets start explaining one by one. 1) Model- It handles data processing and database works part. Model processes event...

  •  

    What is difference between array & arraylist?

    Arraylist is resizable where as using array it is not possible.

    Sukhrob

    • Dec 24th, 2015

    First difference: array is already with fixed size while array lists size could be dynamically changed.

    Secondly, array can include only the same type of data while array list can consist of different primitive data types as well as objects.

    rakesh

    • Nov 18th, 2015

    Array is collection of similar data type values. We cant resizable and growable of array. It is already fixed when you declared while array list works as a dynamic in which size could be grow. It is a part of collection framework to handle or store the collection of object not any type of values.

  •  

    What is the difference between inheritance and extends?

    I have not mistaken extends for polymorphism or encapsulation or anything else.. my question is correct!!!

    ANKIT SHARMA

    • Feb 14th, 2016

    In Inheritance the object aquires all the properties & behaviour of parent object

  •  

    String Format Expression

    In the expression String.format("%2d", 5)
    what are the things below, be specific. for example, if the thing is an operator, indicate whether it is binary/unary and whether it is arithmetic/logical/relational. If it is a method, indicate whether its static or not

    a. String
    b. .
    c. format()
    d. "%2d" and 5

    meena

    • Feb 16th, 2016

    It returns a formatted string with a value of 5.

  •  

    Why java is not 100% object oriented language??

    i have not ..asked in TCS interview ..if any one have plz answer me on er.anuj.mittal@gmail.com

    kiran

    • Mar 1st, 2016

    Because of primitive data types, if we use Wrapper classes then Java is 100% pure object oriented.

    pranathi repaka

    • Feb 11th, 2016

    Object oriented is a concept which not only deals with objects but also with other concepts like class, object, encapsulation, abstraction, message passing, dynamic binding, polymorphism and inheritan...

  •  

    Why we can not override static method?

    Ramesh

    • Feb 4th, 2016

    If a subclass defines a class method with the same signature as a class method in the superclass, the method in the subclass hides the one in the superclass. You didn't override the method a(), because static methods are not inherited. If you had put @Override, you would have seen an error.

  •  

    What is the difference between abstract class & Final class

    baban

    • Feb 11th, 2016

    Abstract class cannot create object but final class create a object
    abstract class which have must a subclassed but final class which have no subclassed

  •  

    What is the use of interface in realtime java project ?

    meena

    • Feb 16th, 2016

    Consider a construction of a building. The basic entire PLAN of the building I what an INTERFACE does. Next, the implementation of that PLAN is done by CONCRETE methods. If some of the work is done and still some is left is what ABSTRACT method/class does.

  •  

    Sub Class method call

    When the Subclass method is called, does the SuperClass constructor execute? If so, which Constructor executes first (Sub Class OR Super Class) for the given below scenarios?
    a. Given that we are NOT inheriting SuperClass constructor?
    b. Given that we are inheriting SuperClass constructor?

    Shrimp

    • Apr 1st, 2016

    When a sub class method is called from parent class, constructor will be executed dude, constructor only executed when you create an object

  •  

    What is throwable and where should we use this?

    Bikram

    • May 4th, 2016

    Throwable is the super class for Error and Exception class. Throwable extends Object class. But more often you will not see the user will be extending Throwable. It is used for Handling Exception. But also when you will be catching multiple Exceptions then it is a good idea to implement this one.

    Anny

    • Dec 18th, 2015

    Thorwable is the parent class for error and exception. It is used for exception handling

  •  

    Mystique Function

    Today we have a special function called Mystique Function.Mystique function for any value x is denoted by H(x). H(x) is defined as the count of positive integers such that (Let k be one of such positive integer)

    1) x%k=0

    2) for every integer z it satisfies (z^k-z)%k=0.

    3) k>1

    Now given a value x you need to print the sum of H(2)+H(3)+H(4)..H(x).

    Rajesh Swarnkar

    • May 8th, 2016

    The condition 2 is not very clear.
    "for every integer z it satisfies (z^k-z)%k=0"

    How would I test the satisfiability against every integer z as they are infinite?

Showing Questions 541 - 560 of 589 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page: