Shyam
private and final
3 Answer(s)      4 years and 2 months ago
Posted in : Java Interview Questions

View Answers

April 14, 2009 at 3:21 PM


Hi Friend,

Private modifier indicates that the variable\method\class can only be accessed within the class and cannot be accessed or instantiated outside.

Final modifier indicates that the variable\method\class cannot be modified in any other classes\subclasses\packages. They cannot be overriden by subclasses. The final class can't be extended and subclassed.You can't change the value of a final variable (is a constant).

The final protects the class writer from changing the value of a final field while private protects the class writer from external code.

Thanks

December 2, 2010 at 5:59 PM


C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks if it is ?Passed? or ?Failed


December 2, 2010 at 6:00 PM


C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks if it is ?Passed? or ?Failed









Related Pages:
private static final
private static final  Why there is necessary to make a variable private static final
private and final - Java Interview Questions
private and final  what is the difference between private modifier and final modifier in java   Hi Friend, Private modifier indicates... be accessed or instantiated outside. Final modifier indicates
The final Keyword
. private and static methods are always implicitly final... The final Keyword       The final is a keyword. This is similar to const keyword in other
Java 5 - "final" is not final anymore - Java Tutorials
{ private final String name; private final int age; private final int iq = 110; private final Object country = "South Africa"; public... to access private fields. However, we could now suddenly rebind final fields
final
final  what does final means in "public static final void main (string args[])" ?   keyword final can be assigned only once. They cannot be modified
Static final variables - Java Beginners
Xyz{ private static final String name="xyz"; public void displayData...Static final variables  can a static final variable be accessed by a instance (non-static)method?  Hi, static final variable u can
Java Final Project - Java Beginners
Java Final Project  I am having a real hard time with this java assignment. Any help or tips will be great!!! This is the requirements: Final... final project. This is your opportunity to show off your skills! Overall
Final Key Word in Java
the compiler will give an error message. Example- private final int j; // Declaring... .style1 { text-align: center; } Final key word in java In java final is a key word used in several different contexts. It is used before
private and protected
private and protected  what is diffrence between private and protected
private constructor
private constructor  can we extend from a class which is having private constuctor
private method
private method  how can define private method in a class and using it in another class in a same package? my source code: class rectangle{ int...; this.breadth=b; } private int calculate(){ int size
private method
private method  how can define private method in a class and using it in another class in a same package? my source code: class rectangle{ int length,breadth; void show(int length,int bredth){ this.length=length; this.breadth
final keyword
final keyword  why is final keyword used in java
Final Keyword
Final Keyword  hello, What is final?   hii In case of class if we use final then this class can not be extended or final class may not be subclassed. A final method can't be overridden when its class is inherited
loop to input multiple points to calculate final distance and speed
loop to input multiple points to calculate final distance and speed  import java.util.Scanner; public class Travel { private double time; private double distance; public Travel() { time=0; distance=0
final variable
final variable  Please give some easiest and understanding example program for final variable
Java private constructor
Java private constructor  what is private constructor?what are the uses of writing private constructor in our program
Private Cloud Hosting
Private Cloud Hosting  Hi, What is Private Cloud Hosting? What are the benefits of Private Cloud Hosting? Thanks
final grade
final grade  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point...?s final grade from 50-100. Evaluate the Final grade and display the Point
Private variable of class
Private variable of class  Hi..... What keyword allows you to refer to private variables of a class in flex? Please give me an example for that Thanks  Ans: private keyword and this keyword
Final Methods - Java Tutorials
The final Keyword in Java In Java, final keyword is applied in various context. The final keyword is a modifier means the final class can't be extended.... final classes The class declared as final can't be subclass or extend
Private Java Keyword
Private Java Keyword       private is a keyword defined in the java programming language. Keywords... in java programming language likewise the private keyword indicates the following
What if the main() method is declared as private?
What if the main() method is declared as private?  Hi, What if the main() method is declared as private? Thanks   Hi, I have found... as private. Visit this link may help you for getting examples with syntax related
What is final class?
What is final class?  Hi, What is final class? thanks   Hi, A final class is not be saubclassed. A final method can't be overridden when its class is inherited. You can't change value of a final variable
Java Final Variable
Java Final Variable  I have some confusion --Final variable has single copy for each object so can we access final variable through class name,or it is necessary to create object for accessing final variable
compute the final grades
compute the final grades  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display... input a student?s final grade from 50-100. Evaluate the Final grade and display
compute the final grades
compute the final grades  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks
compute the final grades
compute the final grades  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks
compute the final grades
compute the final grades  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks
compute the final grades
compute the final grades  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks
compute the final grades
compute the final grades  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point Equivalent based on the table below. Indicate also the remarks
servlet as final - JSP-Servlet
servlet as final  whether we can declare final for a servlet or not? and give the reason
Java: Final keyword
Java NotesFinal keyword The Final word on the final keyword. How often do you use final? Copyleft 2005 Fred Swartz MIT License
Java final keyword
Java final keyword The final is a very important keyword in java, which... with the name "Final" in a Java program. We can have final methods, final classes, final data members, final local variables and final parameters. When
Final Project - Java Beginners
Final Project  The importance of a graphical user interface..., but it is suggested that you begin working on the final project assignment in Week 5, which... the lectures, Quick Test Programs, and Lab assignments will prepare you for the final
What do you understand by private, protected and public?
What do you understand by private, protected and public?   Hi, What do you understand by private, protected and public? thanks
Java final
Java final      ... entity which makes it unchangeable later. We can have final methods, final classes, final data members, final local variables and final parameters. 1
Can a abstract class be declared final?
Can a abstract class be declared final?   Hi, Can a abstract class be declared final? Thanks
Virtual Private Servers
Virtual Private Servers A Virtual Private Server or VPS for short is also know as Virtual Dedicated Server (VDS). Virtual Private Servers is many servers... of a dedicated server to many customers as low cost. In case of Virtual Private Server
Final Cut Pro X
Final Cut Pro X The Final Cut Pro X is the name of new innovation in the video... during video editing. In fact, today Final Cut Pro X has created... introduces the many formerly missing in action section of its Final Cut Pro site
Can a main method be declared final?
Can a main method be declared final?   Hi, Can a main method be declared final? Thanks   Hi, Yes we can. The final method can be declare as follows: public final String convertCurrency() The final method can't
difference between enum and final class?
difference between enum and final class?  what is the difference between enum and final class in java?   The java.lang.Enum is an abstract... A final class cannot be extended. A final class implicitly has all the methods
Final Project II - Java Beginners
Final Project II  Is there anyway I can get the project back by Saturday??? It is due on Sunday by midnight...Thank You
What is the purpose of declaring a variable as final?
What is the purpose of declaring a variable as final?   Hi, What is the purpose of declaring a variable as final? Thanks   Hi, In Java when we declare a final variable as a variable which has been initialized
changing final Boolean value in SwingUtilities.invokeLater()
changing final Boolean value in SwingUtilities.invokeLater()  Hi, I have a problem with setting final Boolean value in second time... static boolean doCommit() { final boolean success = true
Access Modifier
to change the visibility (public, protected, default, private) and other modifiers (final, static, synchronized) of Java classes, interfaces, methods
PHP Final Keyword
Final Keyword in PHP: If you are familiar with Java then you must know the functionality of Final keyword. Final keyword prevents child classes from overriding a method of super or parent class. If we declare a class as final
important for all final years student
important for all final years student   i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common letters
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common words
important for all final years student
important for all final years student  i need a java program for my project, java program for getting path of the file in console while reading a file it should add page number in all pages after that delete all common words

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.