ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
Real Time sample code for Encapsulation and Abstraction.
where to use abstract  and where to use specifies like
public private.
 Question Submitted By :: Rajendra007
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Real Time sample code for Encapsulation and Abstraction. where to use abstract and where to use specifies like public private.
Answer
# 1
Encapsulation & Abstraction:

The private variable declaration is abstration,and making
usage of getters and setters is encapsulation

private String name="";
private String school="";

 public String getName()
{
 return name;
}

public void setName(String name)
{
 this.name=name;
}

When We use private when we want to restrict the access
within the class.

When we use public then the variable or method will be
accessible in all the locations
 
Is This Answer Correct ?    0 Yes 0 No
Ravikiran
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
what is an anonymous class? TCS5
Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites. iGate2
In what ways you can handle exception ?  3
can any one tell me when do u go for inheritance and polymorphism  1
What are different types of access modifiers?  1
What is the need of "creating and throwing an UserdefinedException" when the "Exception" class is already available?  4
Name the class that used to read objects directly from a stream? Wipro2
What is Locale class? MySoft1
I have a sorting issue with a Hashmap. My constraint is that I MUST use the Hashmap and work with existing code. I do a database query and place the results in a Hashmap. When I iterate thru the Hashmap, it loses the original alphabetical sorting done by the database. So, my problem is that I must sort the results coming out of the Hashmap which is then placed into another class.  1
Name two subclasses of the TextComponent class?  2
Explain the difference between scrollbar and scrollpane?  1
What is Connection pooling? Explain Pros and Cons?  1
how to call a method in different package?  4
What are the two major components of JDBC? Mind-Tree4
how u do unit testing? iFlex2
What are the advantages of the model over the event- inheritance model?  1
StringBuilder s = new StringBuilder("Hello Mom");s.append(",I mean,Mother"); Response.Write(s.ToString()); String s = "Hello Mom"; s+ = ",I mean Mom"; Response.Write(s); Which is faster ? which uses the most memory?  4
What is Ideal Design of Class?  2
What is Applet Flickering ? Persistent1
write a class to input 2 points by the user & check the line maked by the points is horizontal,vertical or rectangle?  1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com