[Java daily question] 20161121, java20161121

Source: Internet
Author: User

[Java daily question] 20161121, java20161121

Package Nov2016.use01; class Test {public String getString () {return "123 ";}}
Package Nov2016; import Nov2016.use01. test; public class Ques1121 {public static void main (String [] args) {Test test = new Test (); System. out. println (test. getString ());}}

Today's question:
There are two classes. The Test class is in the Nov2016.use01 package, and the Ques1121 class is in the Nov2016 package. it instantiates a Test object in its main method and calls its getString () method, can the above program be compiled? (Click "[Java daily question] 20161121" below to view issue resolution 20161118)

Questions originally published on the public account and short book: [Java daily question] 20161121, [Java daily question] 20161121

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.