Core Java - Interview Questions and Answers for 'Transient' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Core Java - Interview Questions and Answers for 'Transient' - 3 question(s) found - Order By Newest

 Q1. Can we declare static variables as transient ?Core Java
Ans. It's weird that compiler doesn't complain if we declare transient with static variable because it makes no sense. At least a warning message saying "transient is useless in this situation" would have helped with code cleaning.

Static variables are never serialized and transient is an indication that the specified variable shouldn't be serialized so its kind of double enforcement not to serialize.

It could be that as it makes no different to the variable behavior and hence using both keywords with a variable are permitted.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     static  transient  serialization     Asked in 1 Companies      expert        rare

Try 1 Question(s) Test


Related Questions

  Which of the following combination of keywords is illegal in Java ?

a. static and transient
b. transient and final
c. static and synchronized
d. abstract and final
  Which keyword is used to provide explicit access of a code block to single thread ?

a. Transient
b. Final
c. Explicit
d. Synchronized
  What is the use of Transient Keyword ?
  What are transient variables in java?
  Which of the following is true ?
  Variables of an interface are intrinsically ...

a. transient
b. final
c. public
d. static


  Q2. What is the use of Transient Keyword ?Core Java
Ans. It in Java is used to indicate that a field should not be serialized.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   serialization   transient   java keywords     Asked in 39 Companies      intermediate        frequent

Try 2 Question(s) Test


Related Questions

  Which of the following combination of keywords is illegal in Java ?

a. static and transient
b. transient and final
c. static and synchronized
d. abstract and final
  Which keyword is used to provide explicit access of a code block to single thread ?

a. Transient
b. Final
c. Explicit
d. Synchronized
 Can we declare static variables as transient ?
  What are transient variables in java?
  Which of the following is true ?
  Variables of an interface are intrinsically ...

a. transient
b. final
c. public
d. static


 Q3. What are transient variables in java?Core Java
Ans. Transient variables are variable that cannot be serialized.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   serialization   transient     Asked in 15 Companies      intermediate        rare


Related Questions

  Which of the following combination of keywords is illegal in Java ?

a. static and transient
b. transient and final
c. static and synchronized
d. abstract and final
  Which keyword is used to provide explicit access of a code block to single thread ?

a. Transient
b. Final
c. Explicit
d. Synchronized
 Can we declare static variables as transient ?
  What is the use of Transient Keyword ?
  Which of the following is true ?
  Variables of an interface are intrinsically ...

a. transient
b. final
c. public
d. static



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: