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
prisoha [69]
3 years ago
10

Java !!!

Computers and Technology
1 answer:
coldgirl [10]3 years ago
7 0

Answer:

Explanation:

import java.util.*;

public class BalancedBrackets {

// function to check if brackets are balanced

static boolean isBalanced(String expr)

{

Stack<Character> stack = new Stack<Character>();

for (int i = 0; i < expr.length(); i++)

{

char x = expr.charAt(i);

if (x == '(' || x == '[' || x == '{')

{

// Push the element in the stack

stack.push(x);

continue;

}

if (stack.isEmpty())

return false;

char check;

switch (x) {

case ')':

check = stack.pop();

if (check == '{' || check == '[')

return false;

break;

case '}':

check = stack.pop();

if (check == '(' || check == '[')

return false;

break;

case ']':

check = stack.pop();

if (check == '(' || check == '{')

return false;

break;

}

}

// Check Empty Stack

return (stack.isEmpty());

}

public static void main(String[] args)

{

Scanner scan = new Scanner(System.in);

System.out.println("\nEnter the expression to check is balanced or not !");

String expr = scan.nextLine();

boolean output;

output = isBalanced(expr);

System.out.println(output);

if (output)

System.out.println("Balanced ");

else

System.out.println("Not Balanced ");

scan.close();

}

}

You might be interested in
How does form get its power natural gas
lana [24]

Answer:

because it does

Explanation:

7 0
3 years ago
A Java main method uses the parameter (String[ ] variable) so that a user can run the program and supply "command-line" paramete
Firdavs [7]

Answer:

The answer is "Option a"

Explanation:

  • In java, the main function is the point of entry of every java program. Its syntax always starts "public static void main" with (String args[]), in which it can also be modified by the name of the string array name.
  • It also known as an entry point is the key process. In any program, it is the first method, that executes whenever you run a program. There is one main feature in a regular app that uses instances of certain classes to operate.
4 0
3 years ago
A user is troubleshooting a mobile device app that is displaying errors and has contacted the app manufacturer’s technical suppo
dlinn [17]

Answer:

The answer is "The user uses the method for retrieval, which is dependent on the specific app or devices on the operating system".

Explanation:

For retrieving the requested information of the form, with the user device, he uses the retrieval method, which is based upon the specific application or system operating system.

  • In this, the user can resolve the mobile phone application but also show the errors which have been committed to the assistance team of the application manufacturer.
  • Its repair technician requires detailed system data on the way the software responds and also what triggers the mistakes.
4 0
3 years ago
Can we change the format of a field (e.g. Number to Dollars).
mixer [17]

I think the answer is

3 - Usually, but we may need to convert the data types (date to text)

Because we can change the format, but depends of the original format type and in what type you need to format.

I think this can help.

3 0
3 years ago
What indicates a website of a university
ad-work [718]

Answer:

The domain suffix/TLD .edu is reserved for colleges and universities

Examples:

harvard.edu

stanford.edu

juilliard.edu

8 0
2 years ago
Other questions:
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • When it comes to the best possible security for your wireless router, be sure to use WEP encryption to ensure that your transmis
    14·1 answer
  • Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of s
    8·1 answer
  • The MAA is responsible on a daily basis to protect office computers and patient records and personal information from hackers. R
    12·1 answer
  • What is the model for 2017 Ford Mustang v6
    15·1 answer
  • According to chronology, arrange the steps that you need to take during the installation of a ram stick?
    13·1 answer
  • Using direct mapping, consider a 16-bit memory addresses, and a cache with 64 blocks, where each block is 8 bytes. What is the s
    8·1 answer
  • Identify a true statement about heuristics: a. They are more complicated than algorithms. b. Unlike algorithms, they do not perm
    15·1 answer
  • Why is my internet slow even though the speed test says it is fast
    12·1 answer
  • If you do a Find and Replace for a term, where will Word begin looking for the term?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!