Programmieren – die besten Beiträge

Java Programm umschreiben, brauche hilfe!?

Ich habe dieses Programm geschrieben:

import java.util.Scanner;

public class Queue {

Scanner in = new Scanner(System.in);

class QueuePart {

private String name;

private QueuePart next;

public QueuePart(String name) {

this.name = name;

next = null;}

public QueuePart getNext() {

return next;}

public void setNext(QueuePart next) {

this.next = next;}

public String getName() {return name;

}

}

private QueuePart first, last;

private int elemente;

public Queue() {

first = null;

last = null;

elemente = 0;}

public void leave() {

if(!this.isEmpty()) {

first = first.getNext();

if(this.isEmpty()) {

first = null;

last = null;}

elemente--;}

}

public void enter() {

System.out.printf("Name: ");

String name = in.next();

if(this.isEmpty()) {

first = new QueuePart(name);

last = first;elemente++;}

 else {

last.setNext(new QueuePart(name));

last = last.getNext();

elemente++;}

}

public boolean isEmpty() {

return first == null;

}

public boolean isFull() {

return elemente > 0;

}

public int getElemente() {

return elemente;}

public QueuePart getFirst() {

return first;}

public QueuePart getLast() {

return last;

}

}

Das Programm weiß bisher selbst, wie viele Elemente sich in ihr befinden.

Ich will das Programm jetzt aber umschreiben und will, dass  die Schlange Integerzahlen aufnehmen kann.

Ich will die Instanzvariablen private int nextFree; und private int[] arr; mit einbauen.

Kann mir jemand dabei helfen wie genau ich das umbauen muss?

programmieren, Java

Ist diese Batch Datei sicher?

Geht nur darum was er theoretisch macht, da Kaspersky es als Infizierte Datei anzeigt, ich aber gerne wissen würde warum.

@echo off

title Activate Microsoft Office 2019 ALL versions for FREE!&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2019&echo - Microsoft Office Professional Plus 2019&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&echo Activating your Office...&cscript //nologo ospp.vbs /unpkey:6MWKP >nul&cscript //nologo ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP >nul&set i=1

:server

if %i%==1 set KMS_Sev=kms7.MSGuides.com

if %i%==2 set KMS_Sev=kms8.MSGuides.com

if %i%==3 set KMS_Sev=kms9.MSGuides.com

if %i%==4 goto notsupported

cscript //nologo ospp.vbs /sethst:%KMS_Sev% >nul&echo ============================================================================&echo.&echo.

cscript //nologo ospp.vbs /act | find /i "successful" && (echo.&echo ============================================================================&echo.&echo #My official blog: MSGuides.com&echo.&echo #How it works: bit.ly/kms-server&echo.&echo #Please feel free to contact me at msguides.com@gmail.com if you have any questions or concerns.&echo.&echo #Please consider supporting this project: donate.msguides.com&echo #Your support is helping me keep my servers running everyday!&echo.&echo ============================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto server)

explorer "http://MSGuides.com"&goto halt

:notsupported

echo.&echo ============================================================================&echo Sorry! Your version is not supported.&echo Please try installing the latest version here: bit.ly/aiomsp

:halt

pause >nul

Computer, Microsoft, Office, Schule, Technik, programmieren, VBS, VBScript

Meistgelesene Beiträge zum Thema Programmieren