F&A Diskussionen
why is it not running?
import java.util.Scanner;
public class Myclass{
public static void main(String [] args){
Scanner in = new Scanner(System.in);
String a;
int b;
System.out.println("enter a word");
a = in.nextLine();
System.out.println("enter repetition")
b = in.nextInt();
for ( int = 0; x < b; x = x++)
System.out.println(a);
}
}
0 Stimmen
8 Antwortencan anyone help me understand?
0 Stimmen
1 AntwortI need help!
0 Stimmen
1 AntwortHi my friends
0 Stimmen
1 Antwortwhat next??
-1 Stimme
1 AntwortWhat's next on Sololearn?
3 Stimmen
1 Antwortpublic class Vehicle {
int maxSpeed;
int wheels;
String color;
double fuelCapacity;
void horn() {
System.out.println("Beep!");
}
}
class MyClass {
public static void main(String[ ] args) {
Vehicle v1 = new Vehicle();
Vehicle v2 = new Vehicle();
v1.color = "red";
v2.horn();
System.out.println(v1);
}
}
Explain its outcome. I am unable to get the last line of outcome.
-1 Stimme
2 Antwortenif i download the programs for c++ on my pc ( codebuilds and the compiler ) and i want to write a program in my package ( workspace ) i create a new file and write smthing beginning
#include <iostream>
using namespace std;
int main ()
{
...
}
and i want to run it, it always runs this first program : Hello World. and not my written program how can i run just my written program ?
have i maybe to write anything else as
int main () {} ?
0 Stimmen
16 AntwortenProgramming language
0 Stimmen
1 AntwortHeute heiß
Loops and conditions
2 Votes
photo upload issue in html code
0 Votes
app for lessons
1 Votes
Rise of AI
1 Votes
Need a personal tutor
0 Votes
Community and feed option
0 Votes