Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
peterdemain
8,001 PointsNetbeans. I use it for my foundation degree.
Netbeans. I use it in my foundation degree.
I don't understand there is a light bulb for printf("some blah");
////////////////////////////////////////////////
package treehouse;
import java.io.Console;
public class Treehouse {
public static void main(String[] args) {
Console console = System.console();
//introduction program
-
console.printf("Hello, my name is Peter.");}
}
2 Answers
peterdemain
8,001 PointsThank you. The next video showed
String eXample = "test";
System.out.printf("This is a %s %n" , eXample);
Mark Casavantes
Courses Plus Student 13,401 PointsGood Afternoon Peter,
When you are using printf, you are able to format your print statement. %s is used when a variable is a String and %d is used to represent a decimal. This website may help you understand more about print format statements. https://dzone.com/articles/java-string-format-examples
Best wishes with your studies.
Mark Casavantes
Courses Plus Student 13,401 PointsMark Casavantes
Courses Plus Student 13,401 PointsGood Afternoon Peter,
When you are using TeamTreehouse you are going to print to the console like you did above. When you use an IDE like Netbeans you will print using: