1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dmitry [639]
4 years ago
9

Explain the usage of the keywordtransient?

Computers and Technology
1 answer:
Murljashka [212]4 years ago
8 0

Answer:

'transient' is a java language keyword used to mark fields which should not be included in object serialization.

Explanation:

When an object is serialized, that is, when the object is persisted in the file system, some of the fields may not be relevant for storage and restoration. An example might be a connection object to a database which might become stale by the time when the object is deserialized. Such fields can be marked as 'transient' to ensure that they are not part of the serialization mechanism for the object.Usage is as follows:

transient <datatype> <variable-name>;

e.g.,  

class Demo{

   String name;

   int age;

   transient int income;

}

You might be interested in
Write a function that accepts a list as an argument (assume the list contains integers) and returns the total of the values in t
Serga [27]

Answer:

def listSum(mylist):

   sum =0

   for item in range(0,len(mylist)):

       sum=sum+mylist[item]

   print(sum)

Explanation:

Using the Python programming language, I defined a function as listSum that accepts a list as a parameter and returns the sum of the elements in the list.

The most important logic here is defining the range of elements in the list not to exceed the length of the list using the len function. Then using a for statement, we loop through each element and add them up to a sum variable initially assigned the value of 0.

8 0
4 years ago
Which of the following is a negative effect of the rise in agricultural technology following World War II?
Whitepunk [10]
Is it a multiple choice
6 0
3 years ago
Write a program that multiplies two hard-coded numbers, then prints the individual numbers out and prints their product out, all
sp2606 [1]

Answer:

Written in Python:

num1 = 10

num2 = 15

print(num1)

print(num2)

print(num1 * num2)

Explanation:

The programs requires that two number be assumed and multiplied.

The program uses num1 and num2 to represent the two numbers (line 1 and line2)

These numbers were then initialized to 10 and 15, respectively (note that, you can replace these numbers with any number of your choice)

The next two lines then print num1 and num2

The last line prints the result of their multiplication

However, line by line explanation is as follows:

<em>This line initializes num1 to 10</em>

num1 = 10

<em>This line initializes num2 to 15</em>

num2 = 15

<em>This line prints num1</em>

print(num1)

<em>This line prints num2</em>

print(num2)

<em>This line prints the product of num1 and num2</em>

print(num1 * num2)

5 0
3 years ago
Finding your style in photography is about ___
marusya05 [52]
Only B and C would be the best choice
7 0
3 years ago
Read 2 more answers
How does a pond form?
ehidna [41]

Answer:

B

Explanation:

because the other answers dont make sense

6 0
3 years ago
Other questions:
  • How to write equal to or greater than in word?
    9·1 answer
  • How do you take a screen shot on hp pavilion dm3
    12·1 answer
  • Can anyone drink and drive safely?
    13·2 answers
  • Materials such as copper, silver, and aluminum through which electric energy passes freely are called
    13·1 answer
  • Why do the holes at the top of parachutes make it go slower
    12·1 answer
  • A bank uses a computer program during the night to tell if the alarm should ring. Sensors in the bank set the following Boolean
    5·1 answer
  • How many feet are in 69 inches
    15·1 answer
  • What color and hat do you choose in Among Us
    15·1 answer
  • Imagine that you are preparing a multimedia presentation. What are the four things you need to consider when getting started?
    14·2 answers
  • patty works at Mcdonald's as a chef. it is her job to make hamburgers as each order arrives on her computer screen. one day patt
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!