Core Java Interview Questions

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

    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...

  •  

    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.

  •  

    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.

  •  

    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 ...

  •  

    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...

  •  

    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.

  •  

    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...

  •  

    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...

  •  

    Is there a separate stack for each thread in Java

    Sandip shelke

    • Aug 10th, 2015

    Yes there is separate stack for each thread.
    Bcoz suppose i have created two thread & I am writing a for loop in run method
    which incrment from 1 to 10
    void run()
    {
    for(int i=1;i

    hannarani

    • Apr 3rd, 2008

    Yes. Every thread maintains its own separate stack, called Runtime Stack but they share the same memory. Elements of the stack are the method invocations, called activation records or stack frame. The activation record contains pertinent information about a method like local variables.

  •  

    Threading : - How can you pass data between two threads?

    Sandeep

    • Jul 11th, 2015

    Chaitanya, Can you please explain me, How join() works?
    I am in a situation where two clients (two different threads) are sending data to server and job of server is to fetch data from one client (thread) and feed to another client (thread), but I am unable to identify threads.

    Adham

    • Jun 12th, 2014

    Passing variables through global variable can result in unexpected problems as many threads may try to modify this variable at the same time.
    Programing languages provide different ways to deal with this problem
    as delegates and invocation, pipes, handlers and loppers.

  •  

    Collections

    What is the difference b/w 2d array and hashmap?Where we have to use this?Explain ?

    Thanks in advance

    jahir

    • Apr 9th, 2015

    Array is fixed size and it has doesnt fixed data structure so there is no ready-mate methods for operating we write the explicitly write code burden for the programmer. Advantage: performance wise i...

    kalyankarri

    • Dec 26th, 2014

    2d array is fixed in size ,hashmap size is not fixed 2d array rep.set of elements a[][],hashmap is (key,value) pair in 2d searching is slow ,it visits each n every element ,searchng is based on key ...

  •  

    How many JVM could be run on an operating system. if only one then what is the logical reason.

    utkarsh singhal

    • Mar 6th, 2015

    You can run any number of JVMs on a machine unless and until your machine can provide required resources like RAM to run JVM.
    Similarly, you can install any number of JDKs on your machine.

    Nagarjuna

    • Feb 28th, 2015

    JVM is a OS level process, If we observe Chrome browser - How many tabs you open those many processes will be created by the operating system. In the same way JRE is also designed to run multiple proc...

  •  

    Why do we need interface in Java. Instead of interface we can write the methods in the class itself. Why do we need seperate interface?

    Bhavesh

    • Feb 28th, 2015

    To get the hierarchy of classes that I might need later.

    We dont want the user to know what functionality it offers other than some important We also dont want user to use reflection to exploit functionalities

    punyamca

    • Feb 6th, 2015

    For late binding purpose. to design a method so that a part of functionality has to be mentioned by end user(implementing class)

  •  

    What is the difference between a CallableStatement and PreparedStatement?

    kalyankarri

    • Dec 27th, 2014

    Callable stmt is used to call stored procedure,prepared stmts executes sql queries.

    satyendra kumar

    • Dec 2nd, 2014

    Prepared statement available in java.sql package and its extends statement but callable statement is available in java.sql package and its extends prepared statement ....

  •  

    Generating ppt through java

    I am trying to generate ppt through Java using Apache POI API. I am able to create table, bulleted text etc using this API. Please answer the following two questions, if anyone is aware of this. 1. How to split text across two slides, if the row had to be broken across 2 slides because the row is so big that it can only be accommodated in 2 slide ? 2. How to re-size table cell , if the text...

    Omen

    • Nov 8th, 2013

    Try this Java Library, i hope it will solve your problem:

    http://www.aspose.com/java/powerpoint-component.aspx

  •  

    Why Map is not include in Collection in Java?

    Means, Map is a pert of Collection framework but not included in Collection....only List, Set and Queue are included ....Why?

    siddhi parkar

    • Jul 1st, 2014

    Map in an either interface or class it only stores or maps key to the object.although its not a collection its fully integrated with collection in terms of collection-view of map.

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