answer.
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
frosja888 [35]
1 year ago
8

Assume that the reference variable r refers to a serializable object. Write code that serializes the object to the file ObjectDa

ta.dat.
Computers and Technology
1 answer:
laiz [17]1 year ago
5 0

Answer:

FileOutputStream out = new FileOutputStream("ObjectData.dat");

ObjectOutputStream ostream = new ObjectOutputStream(out);

ostream.writeObject(r);

Explanation:

For object serialization, we can use the writeObject method of java.io.ObjectOutputStream class.

The complete code fragment is as follows:

import java.io.*;

class Demo{

      public static void main(String args[]){

             try{

                  r = <Reference to Object to be serialized> ;

                 FileOutputStream out = new FileOutputStream("ObjectData.dat");

                 ObjectOutputStream ostream = new ObjectOutputStream(out);

                  ostream.writeObject(r);

                 ostream.close();

            } catch(Exception e){

                   e.printStackTrace();

            }

      }

}

You might be interested in
Program documentation _____. Group of answer choices describes the inputs, outputs, and processing logic for all program modules
valentinak56 [21]

Answer:

In the given question the first line is correct, i.e. "Describes the inputs, outputs, and processing logic for all program modules".  

Explanation:

The documentation is a recorded text or image, which is preceding or in the code base of the programs, whether it describes how well the program works and how it is being used, and things in various positions can be influenced by people, and the wrong option can be described as follows:

  • In the documentation, it can't consist of rules and data.
  • In can't include a dictionary, flow maps, screen designs and device requests that began the program.
  • In can't provide links within the program.
6 0
2 years ago
Describe the ways in which a computer-aided design (CAD) drawing makes the details of an image easier to understand.
cupoosta [38]

Answer: CAD is mainly used for detailed engineering of 3D models or 2D drawings of physical components, but it is also used throughout the engineering process from conceptual design and layout of products, through strength and dynamic analysis of assemblies to definition of manufacturing methods of components.

Explanation:

3 0
2 years ago
Read 2 more answers
The population of town A is less than the population of town B. However, the population of town A is growing faster than the pop
defon

Answer:

#include<iostream>

using namespace std;

void main()

{

int townA_pop,townB_pop,count_years=1;

double rateA,rateB;

cout<<"please enter the population of town A"<<endl;

cin>>townA_pop;

cout<<"please enter the population of town B"<<endl;

cin>>townB_pop;

cout<<"please enter the grothw rate of town A"<<endl;

cin>>rateA;

cout<<"please enter the grothw rate of town B"<<endl;

cin>>rateB;

while(townA_pop < townB_pop)//IF town A pop is equal or greater than town B it will break

{

townA_pop = townA_pop +( townA_pop * (rateA /100) );

townB_pop = townB_pop +( townB_pop * (rateB /100) );

count_years++;

}

cout<<"after "<<count_years<<" of years the pop of town A will be graeter than or equal To the pop of town B"<<endl;

}

Explanation:

3 0
2 years ago
Instructions:
Digiron [165]

Answer:

Scenario 1: Advanced Encryption Standard (AES)

It is the best choice for the security of smart phones. AES is symmetric algorithm. It uses keys of 128, 192, and 256 bits and encrypts and decrypts fixed blocks length of 128 bits. It is effective  in encryption of all forms of electronic data. AES encryption is most widely used in smart phones to protect confidential data stored on the device such as bank account information, personal pictures, social security number etc.  It is considered as unbreakable encryption algorithms. For example if smartphone is using AES 256 encryption algorithm to secure its data from attacks, the encrypted data cannot be attacked if the key length is 256-bit as there would be 2256 possible combinations, and a hacker has got to try most of the 2256 possible combinations to guess they key which would take time beyond human lifespan.

Scenario 2:  Digital Signatures  

It is an electronic signature that is used to authenticate the identity of "message sender". It also makes sure that real content of the message has not been changed during transit. Since the company's concern is to protect confidential information from a rival so it the better choice as it assures authentication of message source and data integrity. Digital signatures generate a unique hash of message and use sender's private key to encrypt it. After it the message is signed digitally and sent. Receiver produces his own hash of message. He uses senders's public key to decrypt sender's hash and compares with his own hash. If they match it means the sender is the real one and the message contents are not altered.

Scenario 3: Elliptic curve cryptography (ECC)

It is an asymmetric general-purpose encryption technology. The basic idea behind this method is to generate simple, short, fast and difficult to break encryption keys. This is what the company requires that encryption technology must be general purpose, difficult to break. It uses elliptical curve theory for generating cryptographic keys instead of using large prime numbers. It is efficient to use for smartphones.  ECC does not require much processing power and memory. This results in less overhead faster response time and throughput on Web servers when ECC is being used.

Scenario 4. Secure Sockets Layer (SSL)

It is a standard security technology for setting up an encrypted link between a server and a client (in this case web browsers and web server). SSL is a security protocol that transmits sensitive information securely. As we know data transmitted between browsers and web servers is sent in the form of plain text. If a hacker is able to seize data being transmitted between a browser and a web server, they can misuse that information.  So SSL makes the web servers and web browsers to communicate with each other securely. When transmitting confidential information, a web server and browser set up a secure connection using SSL certificate. The link between web server and browser is encrypted by SSL which makes sure that all data transmitted between them remains private and protected. Due to the sensitive nature of the business SSL is most suitable solution to keep sensitive information sent across internet encrypted making sure that only intended receiver can access it. SSL certificate is used for authentication purpose. For making sure that information is sent to right server, web browsers give indication of secured connection via a lock icon attached or uses https.

Scenario 5: Advanced Encryption Standard (AES)

Confidential Services should choose AES. It is a symmetric encryption algorithm for protecting sensitive data. This means it uses symmetric key encryption in which only one secret key is used to encrypt and decrypt information. This algorithm is also used by U.S. Government agencies to secure sensitive material. Refer to the scenario 1 for more details about AES. It is a fast encryption standard. It is used in both hardware and software. Also it is strong in a sense that it comes up with an option for various key lengths. AES allows  a 128-bit, 192-bit or 256-bit key and are practically unbreakable by brute force based on current computing power

           

 

6 0
2 years ago
Ted knows that macros can be helpful to him in his work with Excel spreadsheets,but he also knows they have their hazards,so he
laila [671]

Answer:

Hhhhhhhhjjjffhkvs4hjtth

Explanation:

H*jhfujttjhfhjfhhdtjdgndrjgr7kvykngimg6

3 0
2 years ago
Other questions:
  • What technique creates different hashes for the same password? ccna routing protocols final answers?
    7·1 answer
  • What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
    10·1 answer
  • Prompt: Which references and reference formats are you most likely to use? Why?<br><br><br> ED2020
    13·2 answers
  • Choose the correct sequence for classifier building from the following.
    7·1 answer
  • If, instead, charge 3 is located to the left of charge 1 at a point (on the x axis) that satisfies the conditions given in the p
    7·1 answer
  • Explain why Windows and Linux implements multiple locking mechanisms. Describe the circumstances under which they use spinlocks,
    13·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    10·1 answer
  • g 18.6 [Contest 6 - 07/10] Reverse an array Reversing an array is a common task. One approach copies to a second array in revers
    8·1 answer
  • Exercise 3.6.9: 24 vs. "24"5 points
    7·1 answer
  • A small e-commerce company uses a series of Robotic Process Automation solutions to manage the backup of data from individual wo
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!