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
Clarissa is a computer programming consultant. When a client states that they have an extremely complex programming task, which
Ann [662]

Answer:i think its D it makes more sense also can i get brainliest

Explanation:

5 0
3 years ago
Read 2 more answers
The only way to print a photo is on a special glossy paper using professional printing services in a store
DaniilM [7]

i believe this is true


8 0
3 years ago
Read 2 more answers
About.com is considered a (an):
Andrei [34K]
About. com that changed its name recently to dotdash is basically a subject directory. It is a colection of blogs articles about various general intrests of writers. Most of the information it contains is not vetted and thus does not qualify as reference point.
7 0
3 years ago
The FTC found CardSystems Solutions and its predecessors __________ the FTC Act 15, U.S.
umka21 [38]

Take because it is lit

6 0
4 years ago
Nonverbal messages from the movie it​
RUDIKE [14]

Answer:

ya you say right

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    13·2 answers
  • If num is an int which expression always evaluates to true if num holds an odd number
    14·1 answer
  • In which of the following scenarios would you use the Redo function?
    12·1 answer
  • Peripherals can be used to output information.<br> True<br> False
    9·2 answers
  • What does PowerPoint display when you use the Notes Page view?
    14·2 answers
  • Amazon.com uses a customer profiling system whenever a customer visits its website. using this system, amazon can offer products
    6·1 answer
  • in java Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, o
    13·1 answer
  • JUST MAXED OUT THE COMMENTS anyways come here
    7·2 answers
  • What would give Lucy, an entry-level candidate, an edge over others while she seeks a programmer’s position? Lucy, an entry-leve
    11·1 answer
  • Leon wants an output from his tablet. What should he look at?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!