Discussion: Lesson 3 - Variables, type system and parsing in Java
BackComments
Member
10 messages from 10 displayed.
//= Settings::TRACKING_CODE_B ?> //= Settings::TRACKING_CODE ?>
Comments
Hi David, I've got a challenge running this script. I've named my project as "Output" and put exactly the same script as you stated it but still showing me an error. Refer to the attachment
package onlineapp;
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
int a;
a = 56;
System.out.println(a);
}
}
Davie kindly ignore. I succeeded when I renamed "onlineapp" and "Program" with project name "output"
Hi David, still have a challenge with running this code below. I named the project as "Basic", I thought I'd replace "package" and "public class" with project name but all in vain. And also at the String output, where do I have to put space and where I shouldn't. Kindly help me on this mate
package onlineapp;
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Hi I am Rael, the virtual parrot, and I love to
repeat!");
System.out.println("Let me fuck you:");
String input;
input = scanner.nextline();
String output;
output = input + "," +input + "!";
System.out.println(output);
}
}
Look at the red underlined parts, those are errors. You have to change the package name in the code to basic, the class name to Basic and there is an error in nextLine (L has to be uppercase).
SIR PLEASE I FIND IT DIFFICULT TO CREAT A NEW PROJECT SIR, PLERASE HELP ME OUT
It was explained in detail in the previous lesson, see https://www.ict.social/…-application
Does it matter,how i start my codes,like will it not run if i start with a small latter?
Java is case-sensitive, so yes, it matters. Always use the correct letter case.
10 messages from 10 displayed.