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
lakkis [162]
3 years ago
15

Give two separate print statements: one will print your name, the other will print your major. Ensure that both will print on th

e same line to the screen
Computers and Technology
1 answer:
Alexus [3.1K]3 years ago
4 0

Answer:

// here is code in java.

// import package

import java.util.*;

// class definition

class Main

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

      // print the name

       System.out.print("my name is Sam. ");

       // print the major

       System.out.print("my major is CS.");

   }catch(Exception ex){

       return;}

}

}

Explanation:

In java, System.out.print() will print the statement but didn't go to the next line.If there is another System.out.print(), then it will also print into the same line.So here first the System.out.print() will print the name and second will print the major in the same line.

Output:

my name is Sam. my major is CS.

You might be interested in
Match the spacing options to their meanings.
Maslowich

Before text = indents paragraph to the right  

First line = indents the start of a paragraph

Register-true = formats page styles  

Line spacing = manages space between two lines  

The first line always gets indent to specify that it is a start of the paragraph

Line spacing always focus on the number of spaces between lines. There are various values available to give spacing according to the need. Register- true is used to format all the page styles and do other related configurations.

3 0
2 years ago
Read 2 more answers
Which type of image is composed of lines, curves, and fills?
Nataliya [291]
<h2>Answer: Vectors</h2>

Explanation:

4 0
3 years ago
PHOTOGRAPHY PLEASE HELP!
BARSIC [14]
1. Portfolios, folders, or drives
2. To make small touch ups and enhance your photos
3. People can steal your photos
4. Because they are trying to capture a story in a photo, and others can change the original intent of their work.
8 0
3 years ago
Hioo ^U^
AlexFokin [52]

Answer:

Hie ......... . thanks for the points

Have a good day

6 0
3 years ago
This menu is used to add a new slide to a presentation.
Igoryamba

Answer:. Insert menu

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • A measure of the twisting or rotational force that an engine can produce is called
    12·1 answer
  • A table with a width set to 600 pixels will look ________ on a monitor with resolution set to 640 × 480 than on a monitor with r
    10·1 answer
  • In what ways us cyberspace is real? list at least 3 examples to support your response .
    9·1 answer
  • Choose the statements that CORRECTLY describe a business organization.​
    11·1 answer
  • Linda installed a special pool for the hydrotherapeutic treatment of severe arthritis, as prescribed by her doctor. The cost of
    5·1 answer
  • As an experienced networking professional, you are asked to conduct a posture assessment on a local credit union’s network. The
    12·1 answer
  • : Show that the propositions (p ∨ q) ∧ (¬p ∨ r) and (p ∧ r) ⊕ (¬p ∧ q) are logically equivalent.
    6·1 answer
  • Write a program to find area of rectangle​
    12·1 answer
  • PowerPoint is best described as:
    13·1 answer
  • Which of the following declares an abstract method in an abstract Java class?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!