Defining and initializing variables
int counter;
String customerLastName;
int loopLimit = 5;
MyClass myObjectTwo = new MyClass( );
float myVariable = 7.2;
CustomerName myNameVariable = new CustomerName("Sharon Hoffman");
Manipulating variables
counter = 0;
customerLastName = new String("Last");
customerLastName = new String(lastName);
displayName = (displayName + " " + customerMiddleInitial +
« . « );
Arithmetic operations
counter = (counter +1);
nextCustomerNumber = (nextCustomerNumber +1);
outputPremium = (inputPremium * 2);
Logical comparisons
(counter <= loopLimit)
(counter == 0)
(!customerMiddleInitial.equals(" "))
Looping (do...while)
do
{
/*
* do while loop processing goes here
*/
}
while(i < 8);
Looping (for)
for(int x = 0; x<5; x= (x+1))
{
/*
* for loop processing goes here
*/
}
Branching
if (!customerMiddleInitial.equals(" "))
{
displayName.append(" ").append(customerMiddleInitial).append(". ");
}
else
{
displayName.append(" ");
}
Input
InputStreamReader myInput = new InputStreamReader(System.in);
BufferedReader myBuffer = new BufferedReader(myInput);
String myInputString = new String();
try
{
myInputString = (myBuffer.readLine());
}
catch(IOException exc)
{
/*
* error handling goes here
*/
}
Output
System.out.println("Hello World");
Téléchargez cette ressource
Créer des agents dans Microsoft 365 Copilot
Insight vous guide dans l’utilisation de la nouvelle expérience de création d’agents dans Microsoft Copilot Studio, disponible dans Copilot Chat. Découvrez les étapes clés pour concevoir, configurer et déployer
ces nouveaux agents et injecter la puissance de l’IA directement dans le flux de travail.