2 files in same package and depends each other need import package??

test1.java and test2.java are in the same package mypackage,
and test1.java will call methods in test2.java, does it mean
test1.java needs to import mypackage.test2;
i.e.
//test1.java
package mypackage;
import mypackage.test2;
class test1
}

no, once classes are in the same packages they are picked up ie tc1 is in tc_package and tc2 is also in tc_package, tc1 need not import tc_package.tc2 to use tc2 methods.
/Paul

Similar Messages

  • Log4J - file appender (2/more file for same package/class)

    Hi All,
    My requirement is i want to create 2 log file for same package.
    EG: com.foo.bar
    my code:
    log4j.rootCategory= ALL, fileAppender,stdout
    log4j.appender.fileAppender=org.apache.log4j.RollingFileAppender
    log4j.appender.fileAppender.File=c:\\temp\\test.log
    log4j.appender.fileAppender.MaxFileSize=64KB
    log4j.appender.fileAppender.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.file1=org.apache.log4j.RollingFileAppender
    log4j.appender.file1.File= file1.log
    log4j.appender.file1.MaxFileSize=64KB
    log4j.appender.file1.MaxBackupIndex=1
    log4j.appender.file1.layout=org.apache.log4j.PatternLayout
    log4j.appender.file1.layout.ConversionPattern=%p %t %c - %m%n
    log4j.appender.file2=org.apache.log4j.RollingFileAppender
    log4j.appender.file2.File= file2.log
    log4j.appender.file2.MaxFileSize=64KB
    log4j.appender.file2.MaxBackupIndex=1
    log4j.appender.file2.layout=org.apache.log4j.PatternLayout
    log4j.appender.file2.layout.ConversionPattern=%p %t %c - %m%n
    log4j.appender.file3=org.apache.log4j.RollingFileAppender
    log4j.appender.file3.File= file3.log
    log4j.appender.file3.MaxFileSize=64KB
    log4j.appender.file3.MaxBackupIndex=1
    log4j.appender.file3.layout=org.apache.log4j.PatternLayout
    log4j.appender.file3.layout.ConversionPattern=%p %t %c - %m%n
    // THIS IS FOR ClIENT
    log4j.logger.com.ls.es.service=DEBUG, file1
    // THIS IS FOR SUPPORT
    log4j.logger.com.ls.es.service=DEBUG, file2
    // THIS IS ERROR MESSAGE
    log4j.logger.com.ls.es.service=ERROR, file3
    Here file1 is for Client(Client Admin)and file2 is for Support.
    but am getting only file3.log file which is for Error Message..
    some where configuration is missing...
    Thanks,
    by
    dhana

    I have created a class that allow to create easily new logs:
    1.- Switch the Root Logger output
    2.- Create as many logs as desired (I build a simple web server, each new client has a log associated to it).
    Main problem: code and comments in spanish.
    Are you intereseted on it? Let me know, I can send it to you by mail.
    Cesar

  • HT5624 My husband and I share an Itunes account so use the same email address and password.  Our iphones are now connected and we get each other's messages and share each other's contacts.  How can we stop this happening?

    My husband and I share an Itunes account so use the same email address and password.  Our iphones are now connected and we get each other's messages and share each other's contacts.  How can we stop this happening?

    A couple of different approached:
    Create a second AppleID for one of you that includes the email address and phone number you wish to use for messaging, but do not apply it to the iTunes and app store (just keep the current one). My wife and I do this and it works quite well. Also allows for easier syncing of Contacts , notes etc. using icloud if you wish to do that.
    Add additional emails/phone numbers to the existing account and change the Send/Receive settings for Messages. this will not fix the Contcts isues for you however.

  • N my house we have 2 iphone 4, and everytime we get the same contact list freom each other, how can we unsync the contacts so each user keeps thir own contact list?

    n my house we have 2 iphone 4, and everytime we get the same contact list freom each other, how can we unsync the contacts so each user keeps thir own contact list?

    Hi user 1724, before icloud, we had the same issue.... 
    so yes,  the solution was to  each log  into the mac separately.
    i kept the main itunes library and apple id, and my son made his own itunes library (which linked to the main itunes/apple id)   - so we were able to maintain separate contacts lists.
    but then w/ the cloud i guess we assumed the cloud would know we each have different contact lists on diff. phones, but it seems the cloud just lumped it all together -

  • When World it be able to log on to The same pages document and see each other corrections When you write/type Them.

    When will it be able to log on to The same pages document and see each other corrections as soon you write/type Them?

    Then use Google Docs if it does what you want.
    MsOffice and LibreOffice are also coming to the iPad, we shall see what they have to offer.
    With luck neither will use iCloud. Apple has yet to get anything right in networking.
    Peter

  • I share an Apple ID with someone but we are now on iOS8 and getting each others messages on our iphones and ipad. How can I split the account safely as well as protect icloud backed up data?

    I share an Apple ID with someone but we are now on iOS8 and getting each others messages on our iphones and ipad. How can I split the account safely as well as protect icloud backed up data?

    Use different Apple IDs for iMessage (and also FaceTime) to avoid getting each others text messages (and FaceTime calls).  One of you should go to Settings>Messages>Send & Receive (and Settings>FaceTime), tap the ID, sign out, then sign back in with a different ID.  You can continue to shared the same ID for the iTunes store and other services.

  • HT4946 hii, on my iphone 4s, i tried upgrading my OS and i was asked if i needed back up and i said yes, after upgrading i couldnt find any of my files, document, pictures, music and all. please i need help please.

    hii, on my iphone 4s, i tried upgrading my OS and i was asked if i needed back up and i said yes, after upgrading i couldnt find any of my files, document, pictures, music and all. please i need help please.

    Hi,
    usually when you upgrade, it should not delete your files, but if it happens, than you should have a backup.
    Unfortunately it is very common, that people don't know, what exactly is in the backup.
    The question is, what files exactly you are missing? Own pictures, or taken with the device? Purchased music form the iTunes Store, or own? ....
    Documents and files are mostly up to the developer of the app, if they are part of the backup, usually not and you need to transfer them before.
    In the backup you will find just pictures from the Camera Rolle folder, everything else you should have on the PC, if you had it on the device.
    Same then for music, you can transfer purchased music from the device, but your own works just one direction, from PC to device, from device to PC it doesn't work.
    In future I recomand you to be sure how the backup works or use a 3rd party app (iExplorer) where you have a little bit more "freedome" than with iTunes.
    Or you maybe just restored from the worng backup

  • I am trying to import my bookmarks from IE and have read the instructions of how to do this, but the Import button under File is grayed out and will not let me import. Any ideas?

    I am trying to import my bookmarks from IE and have read the instructions, but the Import button under File is grayed out and will not let me import. Any ideas?

    * Make sure that you not run Firefox in [[Private Browsing]] mode
    * In Private Browsing mode some menu items are disabled (grayed) and features like visited links are disabled and not showing
    * You are in Private Browsing mode if you see "Tools > Stop Private Browsing", possibly grayed
    See [[Private Browsing]]

  • Lightweight APs seeing neighbors several floors above and below each other

    Hello All,
    I noticed in our PI 2.1 that our access points are seeing neighbors several floors above and below each other.  For example.  I have an AP thats at least 2 floors below ground that's seeing an AP on the 6th floor.  The controller TPC is set to a fix value of 5 on the 2.4 band.  What's even more strange is that the person reporting constant disconnects is on this level below ground but is connected to an AP on the 6th Floor when there's an AP right outside of the door where she is physically located.  Any ideas of what to do or look for?
    Regards,
    Terence

    I wouldn't blame you if you put a low rating in my previous recommendation about disabling Band Select.  I am wrong.  I got confused with Client Load Balancing.  Client Load Balancing should be disabled.  I am wrong and I apologize for the confusion.
    Make sure you choose TPCv1 and NOT v2.  You can set DCA Channel Assignment Method to 24 hours.  This prevents the WLC changing channels regularly.  Make sure when you enable "24-hours" you set this very early or very late in the afternoon so no one is there.  Alternatively, you can reboot the WLC at midnight.

  • How can I have two PDFs open at the same time next to each other?

    How can I have two PDFs open at the same time next to each other?

    Moved to Adobe Reader for iOS.
    The only way I know how to do that is with two iPads.

  • How to make 2 clients on same VLAN communicate to each other when tunnel-loop-prevention is enabled?

    Requirement:
    How to make two clients on same VLAN communicate to each other when tunnel-loop-prevention is enabled on tunneled-node configuration at controller?
    Whenever we enable tunnel-loop-prevention on controller while we configure tunneled-node, the communication between two tunneled-node client on same VLAN is blocked or dropped.
    If the tunneled-node clients are of different VLANs then they can communicate between them even when the tunnel-loop-prevention is enabled on the controller.
    Solution:
    To make two tunneled-node client on same VLAN to communicate between them, we need to enable "local-proxy-arp" for the interface VLAN on the controller.
    Once it is enabled now the tunneled-node clients on same VLAN can communicate between each other. 
    Configuration:
    To enable "local-proxy-arp":
    Get to the interface of the VLAN on the controller
    Example :
    (config)#interface vlan 5
    (config)#ip local-proxy-arp
    To enable tunnel loop prevention on controller
    (config)# tunnel-loop-prevention
    Verification
    Show commands:
    To check if tunnel-loop-prevention is enabled or disabled
    #show tunneled-node config
    Tunnelded node Server: Enabled
    Tunnel Loop Prevention: Enabled
    To check if local-proxy-ap is enabled:
    #show interface vlan 5
    Look for in the output "ProxyARP enable"

    streetfi8er wrote:
    Server ready,waiting for client:
    Exception in thread "New THREAD" java.lang.NullPointerException
         at server4$server4Thread.run(server4.java:88)
    Failed to accept client
    when i run the second client programme on different a console in the same system i get the error that:
    Unknown HostOK, I'm no socket programming expert; but I can see a few potential problems with what you've written.
    1. First off, which line is line 88? Line numbers would be useful. Also, indenting your code properly would make it easier to read.
    2. Your 'while(!str.equalsIgnoreCase("close"))' will always fail with a NullPointerException because 'str' is initially set to null.
    3. Your 'while(true)' loop worries me. How does it exit? Relying on an exception is usually very bad practise.
    4. You are not handling SecurityExceptions. While it's unlikely to happen on your machine; it could easily happen on another.
    5. It might be worth indicating the actual exception thrown in your "Failed to accept client" message. accept() can throw three different types of IOException.
    6. All the threads you create will be called "New THREAD", which doesn't provide much value.
    HIH
    Winston

  • Extract All Embedded Files in All Folders and Save Each? Copy/Paste from PDF to Word?

    I have most of what I need here, but I’m missing 2 important pieces. 
    #1)  I want to copy/paste from all PDF files in a folder and paste the copied data into a single Word file. 
    It works fine if I have ONLY Word docs in my folder.  When I have PDF files and Word files, the contents of the Word files are copied in fine, but the contents of the PDF files seem to come in as Chinese, and there is no Chinese in
    the PDF, so I have no idea where that’s coming from.
    #2)  I want to extract all embedded files (in all my Word files) and save the extracted/opened file into the folder.  Some embedded files are PDFs and some are Excel files.
    Here the code that I’m working with now.
    Sub Foo()
    Dim i As Long
    Dim MyName As String, MyPath As String
    Application.ScreenUpdating = False
    Documents.Add
    MyPath = "C:\Users\001\Desktop\Test\" ' <= change this as necessary
    MyName = Dir$(MyPath & "*.*") ' not *.* if you just want doc files
    On Error Resume Next
    Do While MyName <> ""
    If InStr(MyName, "~") = 0 Then
    Selection.InsertFile _
    FileName:="""" & MyPath & MyName & """", _
    ConfirmConversions:=False, Link:=False, _
    Attachment:=False
    Dim Myshape As InlineShape
    Dim IndexCount As Integer
    IndexCount = 1
    For Each Myshape In ActiveDocument.InlineShapes
    If Myshape.AlternativeText = PDFname Then
    ActiveDocument.InlineShapes(IndexCount).OLEFormat.Activate
    End If
    IndexCount = IndexCount + 1
    Next
    Selection.InsertBreak Type:=wdPageBreak
    End If
    On Error Resume Next
    Debug.Print MyName
    MyName = Dir ' gets the next doc file in the directory
    Loop
    End Sub
    If this has to be done using 2 Macros, that’s fine. 
    If I can do it in 1, that’s great too.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Hi ryguy72,
    >>When I have PDF files and Word files, the contents of the Word files are copied in fine, but the contents of the PDF files seem to come in as Chinese, and there is no Chinese in the PDF, so I have no idea where that’s coming from.<<
    Based on the code, you were insert the file via the code Selection.InsertFile. I am trying to reproduce this issue however failed. I suggest that you insert the PDF file manually to see whether this issue relative to the specific file. You can insert PDF
    file via Insert->Text->Object->Text from file.
    If this issue also could reproduced manually, I would suggest that you reopen a new thread in forum to narrow down whether this issue relative to the specific PDF file or Word application.
    >> I want to extract all embedded files (in all my Word files) and save the extracted/opened file into the folder.  Some embedded files are PDFs and some are Excel files.<<
    We can save the embedded spreadsheet via Excel object model. Here is an example that check the whether the inlineshape is an embedded workbook and save it to the disk for you reference:
    If Application.ActiveDocument.InlineShapes(1).OLEFormat.ClassType = "Excel.Sheet.12" Then
    Application.ActiveDocument.InlineShapes(1).OLEFormat.DoVerb xlPrimary
    Application.ActiveDocument.InlineShapes(1).OLEFormat.Object.SaveAs "C:\workbook1.xlsx"
    Application.ActiveDocument.InlineShapes(1).OLEFormat.Object.Close
    End If
    And since the Word object model doesn't provide API to save the embedded PDF, I would suggest that you get more effective response from PDF support forum to see whether it supports automation. If yes, we can export the PDF as embedded spreadsheet like code
    absolve.
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Logo and text required in the same window adjacent to each other

    Hi experts,
    Kindly provide a solution to get logo and some text adjacent to each other inside a single window using SAP SCRIPTS.

    pass th logo in to paint and add the text u want in to it.......
    and make it as a image file ...
    and use that image in ur script................
    Regards
    Anbu B

  • Search multiple folders for files with same name and create single file

     I have a project where I need to search multiple folders for a file name and when found append data from each file to a single input file.
     Example
    root folder to start search
    \\servera\sales
    \\servera\it\salesa\cmmstr.txt
    \\servera\it\salesb\cmmstr.txt
    \\servera\it\salesc\cmmstr.txt
     I need to create a a single cmmstr.txt on the root folder. I would like it to be able to run this with parms to pass in folders to search and file names to search and single file name to create. I'm going to have a least 10 differnt files to
    search for and create output file for. The folders to search
    will somewhat be static.
     Thanks.

    I tested this out on my own seat and I think it should work for you. I wrote it as a function, all you have to do is pass the root folders you want to search and the file your looking for. The function will then search that directory and all sub directories
    for that file name. you will also have to provide it a file to append to, if the file dosen't exists the function will create it. If you run into an issues let me know and the links Mike
    Laughlin posted are a great resource.
    Function Search-Files{
    Param([String[]]$Locations, $SearchFor, $AppendTo)
    Begin
    If(-Not (Test-Path $AppendTo)){New-Item $AppendTo -ItemType File -Force}
    Process
    ForEach($Location in $Locations)
    $Files = Get-ChildItem -Path $Location -Filter $SearchFor -Recurse
    ForEach($File in $Files)
    Get-Content -Path $FIles.FullName | Out-File $AppendTo -Append
    End{}
    Search-Files -Locations "\\Server1\c$\Temp", "\\Server1\c$\Test1" -SearchFor "Install.cmd" -AppendTo "C:\Temp\Search.log"

  • 2 files in same package need import package??

    test1.java and test2.java are in the same package mypackage,
    and test1.java will call methods in test2.java, does it mean
    test1.java needs to import mypackage.test2;
    Because I found sometimes it won't compile test1.java without import mypackage.test2..
    i.e.
    //test1.java
    package mypackage;
    import mypackage.test2;
    class test1

    You shouldn't need to import a class that lies in the same package.
    Cyric

Maybe you are looking for