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
frosja888 [35]
3 years 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]3 years 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
one business rule is that each project has one manager. Identify two (and no more than two) problems with the data structure or
Vinil7 [7]

Answer:

1. The data will not be tallying up - there will great variations and deviance.

2. There will be not enough data points

Explanation:

The management style, though it uses one manager, is not devoid of problems in the system. For example, there will be great difficulty in the collection of accurate data to properly define the system. This presents a great misinformation on the outcome of the data process. This is likely to be caused by the first factor that is the data having a lot of discrepancies. The discrepancy causes the data to be meaningless in terms of the trends displayed. In addition, the lack of enough points posses a challenge to the data collection and processing procedure. The data base management system can be used to concentrate data on a central point of reference.

3 0
3 years ago
Implement a simplified version of a crypto broker platform. Initially, there is an array of users, with each user depositing onl
Salsk061 [2.6K]
Jriririiekeekekkksks
3 0
3 years ago
In what cases would you denormalize tables in your database?
ad-work [718]

Answer: Denormalize is the mechanism is carried out by addition of the redundant bits in the already normalized database.The data is attached in the form of attributes,adding new tables.

This technique is used in the case of previously normalized data collection which requires improvement in the performance by reducing the errors.The improvement is made by making database readable ,adding  group of data in redundant form etc.

When data is to be retrieved quickly then also denormalization is used as by grouping or collecting information into a single table.

6 0
3 years ago
To begin designing a relational database, one must define the _____ by defining each table and the fields in it. primary key phy
Ugo [173]

Answer:

To begin designing a relational database, one must define the Logical structure

Explanation:

Primary key: It is a unique key which uniquely identifies each record in a table. So this does not purely defines the relationship of the table during the beginning of the design.

Foreign key: It is a key which is closely connected to the primary key. The value of the column will accept values only if the values exists in the base table.

Physical structure: This is not going to be related to the relationship of the structure since the storage management is done by Operating system.

Only the logical structure clearly defines the relationship in the database. It will have information about the list of tables and fields. It will also mark the relationship between one table and another.

8 0
4 years ago
PrintErrorDescription is a function that accepts one int parameter and returns no value. Write a statement that calls the functi
dmitriy555 [2]

Answer:

  1.    public static void main(String[] args) {
  2.        printErrorDescription(14);
  3.    }
  4.    public static void printErrorDescription(int value){
  5.        //some codes
  6.    }

Explanation:

Given a function <em>printErrorDescription() </em>with one parameter (Line 5 - 7). To call the function, we can write the function name and place the value of 14 within the parenthesis (Line 2). The value of 14 is a function argument. The value of 14 will be processed within the function to meet some purposes.    

3 0
4 years ago
Other questions:
  • According to the Big Five Factors model, all but _____ are categories.
    11·1 answer
  • What type of impacts can a computer virus have on a computer?
    12·1 answer
  • _______________ is the term for the convergence of real-time and non-real-time communications services such as telephony, instan
    11·1 answer
  • What happens when you click the house icon on the right side of the screen?
    7·1 answer
  • Write a program that displays the values in the list numbers in ascendingorder sorted by the sum of their digits.
    8·1 answer
  • In 5-10 sentences, describe how computer networks work.
    6·1 answer
  • Create ER Models &amp; Normalization for the following scenarios:
    5·1 answer
  • The attacker sent data that was able to manipulate the return address that is reserved to store expected data
    5·1 answer
  • How can you have internet without subscribing to cable?
    13·1 answer
  • Scott sends his backups to a company that keeps them in a secure vault. What type of backup solution has he implemented?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!