Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I can't seem to find an error in the block.

What I have tried:

import java.util.Date;

public class Welcome
{
	public static void main(String[] args)
	{
		Date currentDate = new Date(); //Date constructor
		System.out.printIn();
		System.out.printIn("\t\t\tWelcome to my day!");
		System.out.printIn("\t\t\tDaily Planner for Linda Nunez");
		System.out.printIn("\t\t\t" + currentDate);
		System.out.printIn();
	}
}


Once I try compiling it the following errors occur:

C:\Java 1\New folder (2)\Chapter 02\Welcome.java:17: cannot find symbol
symbol : method printIn()
location: class java.io.PrintStream
System.out.printIn();
^
C:\Java 1\New folder (2)\Chapter 02\Welcome.java:18: cannot find symbol
symbol : method printIn(java.lang.String)
location: class java.io.PrintStream
System.out.printIn("\t\t\tWelcome to my day!");
^
C:\Java 1\New folder (2)\Chapter 02\Welcome.java:19: cannot find symbol
symbol : method printIn(java.lang.String)
location: class java.io.PrintStream
System.out.printIn("\t\t\tDaily Planner for Linda Nunez");
^
C:\Java 1\New folder (2)\Chapter 02\Welcome.java:20: cannot find symbol
symbol : method printIn(java.lang.String)
location: class java.io.PrintStream
System.out.printIn("\t\t\t" + currentDate);
^
C:\Java 1\New folder (2)\Chapter 02\Welcome.java:21: cannot find symbol
symbol : method printIn()
location: class java.io.PrintStream
System.out.printIn();
Posted
Updated 16-Jul-18 6:32am
v2

It's not "printIn".

It should be to be "println", or if expanded in English, "print line". Replace the "I" with an "l".
 
Share this answer
 
v2
Comments
Member 13652359 16-Jul-18 13:37pm    
TY Bro
Quote:
System out printIn();
Should be instead

Java
System.out.printIln();

And so on...
 
Share this answer
 
Quote:
The error pointer shows to the 'p' in printIn.

Because 'System out' is not Java.
I would try something like
Java
System.out.printIn();

otherwise check in documentation.

[Update]
May be you should try printLn()
 
Share this answer
 
v2
Comments
Member 13652359 16-Jul-18 9:58am    
After correctifying it I got a new error:

java:17: cannot find symbol
symbol : method printIn()
location: class java.io.PrintStream
System.out.printIn();
Patrice T 16-Jul-18 10:00am    
Use Improve question to update your question.
So that everyone can pay attention to this information.
Don't forget to update the source code too.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900