Please if i may ask, when i add the Scanner scn and it's statements and method, please how do i add the panel for it like giving it a display and making it receive and give out info?
Basic Java for N00blets pt.2: Important Classes Intro to Scanner, String, Math, DecimalFormat, & Random
#17
Posted 29 October 2015 - 04:02 PM
That's an odd question. When you run your application the console appears.. which the Scanner uses to read values and print output.
Are you asking how to run an application? In which case you could start with part I of this tutorial, or a book.
Are you asking how to run an application? In which case you could start with part I of this tutorial, or a book.
This post has been edited by andrewsw: 29 October 2015 - 04:03 PM
#18
Posted 29 October 2015 - 04:14 PM
that's my class and the output is not what i expect but am sure am missing something
i want my output to be in a frame or such panel to display my expression down there.
output <no main classes found>
i want my output to be in a frame or such panel to display my expression down there.
import java.util.Scanner; public class Hello { String firstName = ""; String lastName = ""; Scanner scn = new Scanner(System.in); { System.out.println("Please Enter Your Name (First Name:"); firstName = scn.next(); lastName = scn.next(); System.out.println("Hello" + firstName + "" + lastName); } }
output <no main classes found>
Attached image(s)
#19
Posted 29 October 2015 - 04:22 PM
Quote
output <no main classes found>
You need a main() method. If you don't know this then you should not be starting with Part 2 of a tutorial. You need to start with the very basics of Java.
Your issues are not related to this tutorial, but to the basics of Java, so if you have more questions start a new topic in the Java forum.
This post has been edited by andrewsw: 29 October 2015 - 04:24 PM
#20
Posted 04 November 2015 - 01:15 AM
Your url link is messed up at the bottom by the way.

#21
Posted 03 December 2015 - 09:25 AM
Thank you so much for this! Just ending CS1 learning Java, and this is a great reference to look back to when I forget which exact method I need to solve a problem.