uppString
commit
e6c47c77a9
|
|
@ -0,0 +1,167 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<actions>
|
||||||
|
<action>
|
||||||
|
<actionName>run</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-classes</goal>
|
||||||
|
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.vmArgs></exec.vmArgs>
|
||||||
|
<exec.args>--enable-preview ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.appArgs></exec.appArgs>
|
||||||
|
<exec.mainClass>${packageClassName}</exec.mainClass>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>debug</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-classes</goal>
|
||||||
|
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
|
||||||
|
<exec.args>--enable-preview ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.appArgs></exec.appArgs>
|
||||||
|
<exec.mainClass>${packageClassName}</exec.mainClass>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
<jpda.listen>true</jpda.listen>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>profile</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-classes</goal>
|
||||||
|
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.vmArgs></exec.vmArgs>
|
||||||
|
<exec.args>--enable-preview ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.mainClass>${packageClassName}</exec.mainClass>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>run.single.main</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>*</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-classes</goal>
|
||||||
|
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.vmArgs></exec.vmArgs>
|
||||||
|
<exec.args>--enable-preview ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
<exec.mainClass>${packageClassName}</exec.mainClass>
|
||||||
|
<exec.classpathScope>${classPathScope}</exec.classpathScope>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>debug.single.main</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>*</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-test-classes</goal>
|
||||||
|
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
|
||||||
|
<exec.args>--enable-preview ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
<exec.mainClass>${packageClassName}</exec.mainClass>
|
||||||
|
<exec.classpathScope>${classPathScope}</exec.classpathScope>
|
||||||
|
<jpda.listen>true</jpda.listen>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>profile.single.main</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>*</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-classes</goal>
|
||||||
|
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.vmArgs></exec.vmArgs>
|
||||||
|
<exec.args>--enable-preview ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.mainClass>${packageClassName}</exec.mainClass>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
<exec.classpathScope>${classPathScope}</exec.classpathScope>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>test</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>*</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>test</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<argLine>--enable-preview</argLine>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>test.single</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>*</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-test-classes</goal>
|
||||||
|
<goal>surefire:test</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<test>${packageClassName}</test>
|
||||||
|
<argLine>--enable-preview</argLine>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>debug.test.single</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>*</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-test-classes</goal>
|
||||||
|
<goal>surefire:test</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<test>${packageClassName}</test>
|
||||||
|
<forkMode>once</forkMode>
|
||||||
|
<maven.surefire.debug>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</maven.surefire.debug>
|
||||||
|
<jpda.listen>true</jpda.listen>
|
||||||
|
<argLine>--enable-preview</argLine>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>profile.test.single</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>*</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-test-classes</goal>
|
||||||
|
<goal>surefire:test</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<test>${packageClassName}</test>
|
||||||
|
<forkMode>once</forkMode>
|
||||||
|
<maven.surefire.debug>${exec.vmArgs}</maven.surefire.debug>
|
||||||
|
<exec.vmArgs></exec.vmArgs>
|
||||||
|
<exec.args></exec.args>
|
||||||
|
<argLine>--enable-preview</argLine>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
</actions>
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.mycompany</groupId>
|
||||||
|
<artifactId>mavenproject10</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.11.0</version>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>--enable-preview</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.release>24</maven.compiler.release>
|
||||||
|
<exec.mainClass>com.mycompany.mavenproject10.Mavenproject10</exec.mainClass>
|
||||||
|
</properties>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.mycompany.mavenproject10;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author 250402
|
||||||
|
*/
|
||||||
|
public class Mavenproject10 {
|
||||||
|
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// Scanner scanner = new Scanner(System.in);
|
||||||
|
// System.out.println("Introduza o seu nome");
|
||||||
|
// String nome = scanner.nextLine();
|
||||||
|
// System.out.println("Introduza a sua morada");
|
||||||
|
// int idade = scanner.nextInt();
|
||||||
|
// System.out.println("introduza a sua idade");
|
||||||
|
// String morada = scanner.nextLine();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// *morada*
|
||||||
|
// nomedaString.charArt(posiçaoDoCaracter) -
|
||||||
|
// obtenção de um caracter numa posição
|
||||||
|
// nomeDaString.contains(textoOuVariavelAIdentificar) -
|
||||||
|
// verifica se a String termina com um determinado texto
|
||||||
|
// NomedaString.StartsWith(TextoOuVariavelAVerificar)
|
||||||
|
// verifica se a String começa com um determinado texto
|
||||||
|
// NomedaString.equals(TextoOuVariavelAVerificar)
|
||||||
|
// verifica se duas String sao iguais
|
||||||
|
// NomedaString.indexOf(TextoOuVariavelAVerificar)
|
||||||
|
// devolve a primeira posiçao do caracter a procurar
|
||||||
|
// NomedaString.lastIndexOf(TextoOuVariavelAVerificar)
|
||||||
|
// devolve a ultima posiçao do caracter a procurar
|
||||||
|
// NomedaString.isEmpty()-verifica se a String esta vazia
|
||||||
|
// NomedaString.isBlank()-verifica se a String esta vazia
|
||||||
|
// NomedaString.subString(posiçãoInicial) - verifica se duas strings são iguas
|
||||||
|
// nomeDaString.indexOf(caracterAProcurar)- devolve a primeira posição do caracter a procura
|
||||||
|
// NomeDaString.lastIndexOf(Caracteraprocura)- devolve a primeira posição do caracter a procura
|
||||||
|
// NomeDaString.isEmpty() - verifica se a String está vazia
|
||||||
|
// NomeDaString.isBlank()- verifica se a String está vazia
|
||||||
|
// NomeDaString.subString(posicaoInicial)- corta a String a partir da posicao indicada
|
||||||
|
// NomeDaString.subString(posicaoInicial, posicaoFinal)- corta a String entre as posiçoes indicadas
|
||||||
|
// NomeDaString.toLowerCase() - passa a String para minusculas
|
||||||
|
// NomeDaString.toUpperCase() - passa a String para maiusculas
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Scanner scanner = new Scanner(System.in);
|
||||||
|
System.out.println("Introduza o seu nome");
|
||||||
|
String nome = scanner.nextLine();
|
||||||
|
|
||||||
|
System.out.println("A quantidade de carcteres é"
|
||||||
|
+ nome.length());
|
||||||
|
System.out.println("Em minúsculas:"
|
||||||
|
+ nome.toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue